Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a4991a0

Browse files
committed
Arrange master with stable15
1 parent 18e8789 commit a4991a0

15 files changed

+104
-111
lines changed

.github/workflows/c-cpp.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: C/C++ CI for the master
1+
name: 'C/C++ CI for the master'
22

33
on:
44
push:
@@ -7,7 +7,7 @@ on:
77
branches: [ master ]
88

99
env:
10-
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
10+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
1111

1212
jobs:
1313
build:
@@ -18,18 +18,20 @@ jobs:
1818
- name: pg
1919
run: |
2020
sudo apt install libipc-run-perl
21+
2122
echo "Deploying to production server on branch" $BRANCH_NAME
2223
git config --global user.email "ci@postgrespro.ru"
2324
git config --global user.name "CI PgPro admin"
2425
export COPT=-Werror
2526
export CONFIGURE_OPTS="--prefix=`pwd`/tmp_install --enable-tap-tests --enable-cassert"
2627
git clone https://github.com/postgres/postgres.git pg
2728
cd pg
29+
2830
git checkout master
29-
./configure $CONFIGURE_OPTS CFLAGS="-O3"
3031
git clone https://github.com/postgrespro/aqo.git contrib/aqo
3132
git -C contrib/aqo checkout $BRANCH_NAME
3233
patch -p1 --no-backup-if-mismatch < contrib/aqo/aqo_master.patch
34+
./configure $CONFIGURE_OPTS CFLAGS="-O3"
3335
make -j4 > /dev/null && make -j4 -C contrib > /dev/null
3436
env CLIENTS=50 THREADS=50 make -C contrib/aqo check
3537

aqo--1.4--1.5.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ CREATE VIEW aqo_queries AS SELECT * FROM aqo_queries();
7777
/* UI functions */
7878

7979

80-
CREATE FUNCTION aqo_enable_class(queryid bigint)
80+
CREATE FUNCTION aqo_enable_query(queryid bigint)
8181
RETURNS void
82-
AS 'MODULE_PATHNAME', 'aqo_enable_class'
82+
AS 'MODULE_PATHNAME', 'aqo_enable_query'
8383
LANGUAGE C STRICT VOLATILE;
8484

85-
CREATE FUNCTION aqo_disable_class(queryid bigint)
85+
CREATE FUNCTION aqo_disable_query(queryid bigint)
8686
RETURNS void
87-
AS 'MODULE_PATHNAME', 'aqo_disable_class'
87+
AS 'MODULE_PATHNAME', 'aqo_enable_query'
8888
LANGUAGE C STRICT VOLATILE;
8989

9090
CREATE FUNCTION aqo_queries_update(

aqo.c

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include "access/relation.h"
1616
#include "access/table.h"
17+
#include "catalog/objectaccess.h"
1718
#include "catalog/pg_extension.h"
1819
#include "commands/extension.h"
1920
#include "miscadmin.h"
@@ -23,11 +24,10 @@
2324
#include "aqo_shared.h"
2425
#include "cardinality_hooks.h"
2526
#include "path_utils.h"
27+
#include "postmaster/bgworker.h"
2628
#include "preprocessing.h"
2729
#include "learn_cache.h"
2830
#include "storage.h"
29-
#include "postmaster/bgworker.h"
30-
#include "catalog/objectaccess.h"
3131

3232

3333
PG_MODULE_MAGIC;
@@ -118,6 +118,9 @@ ExplainOneNode_hook_type prev_ExplainOneNode_hook;
118118
static shmem_request_hook_type prev_shmem_request_hook = NULL;
119119
object_access_hook_type prev_object_access_hook;
120120

121+
PGDLLEXPORT void aqo_bgworker_cleanup(Datum main_arg);
122+
static void aqo_bgworker_startup(void);
123+
121124
/*****************************************************************************
122125
*
123126
* CREATE/DROP EXTENSION FUNCTIONS
@@ -156,18 +159,18 @@ aqo_shmem_request(void)
156159
* Entry point for CleanupWorker's process.
157160
*/
158161
void
159-
aqo_bgworker_cleanup(void)
162+
aqo_bgworker_cleanup(Datum main_arg)
160163
{
161164
int fs_num;
162165
int fss_num;
163166

164167
cleanup_aqo_database(true, &fs_num, &fss_num);
165168
}
166169

167-
/*
170+
/*
168171
* Object access hook
169172
*/
170-
void
173+
static void
171174
aqo_drop_access_hook(ObjectAccessType access,
172175
Oid classId,
173176
Oid objectId,
@@ -198,7 +201,7 @@ aqo_drop_access_hook(ObjectAccessType access,
198201
}
199202
}
200203

201-
void
204+
static void
202205
aqo_bgworker_startup(void)
203206
{
204207
BackgroundWorker worker;
@@ -355,7 +358,7 @@ _PG_init(void)
355358
&fs_max_items,
356359
10000,
357360
1, INT_MAX,
358-
PGC_SUSET,
361+
PGC_POSTMASTER,
359362
0,
360363
NULL,
361364
NULL,
@@ -368,7 +371,7 @@ _PG_init(void)
368371
&fss_max_items,
369372
100000,
370373
0, INT_MAX,
371-
PGC_SUSET,
374+
PGC_POSTMASTER,
372375
0,
373376
NULL,
374377
NULL,
@@ -406,7 +409,7 @@ _PG_init(void)
406409
NULL,
407410
&cleanup_bgworker,
408411
false,
409-
PGC_USERSET,
412+
PGC_SUSET,
410413
0,
411414
NULL,
412415
NULL,
@@ -484,7 +487,7 @@ _PG_init(void)
484487
*/
485488
AQOLearnMemCtx = AllocSetContextCreate(AQOTopMemCtx,
486489
"AQOLearnMemoryContext",
487-
ALLOCSET_DEFAULT_SIZES);
490+
ALLOCSET_DEFAULT_SIZES);
488491
RegisterResourceReleaseCallback(aqo_free_callback, NULL);
489492
RegisterAQOPlanNodeMethods();
490493

aqo.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
autovacuum = off
22
shared_preload_libraries = 'postgres_fdw, aqo'
33
max_parallel_maintenance_workers = 1 # switch off parallel workers because of unsteadiness
4-
aqo.wide_search = 'on'
4+
aqo.wide_search = 'on'
5+
compute_query_id = 'regress'

aqo.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@
142142
#include "utils/rel.h"
143143
#include "utils/fmgroids.h"
144144
#include "utils/snapmgr.h"
145-
#include "catalog/objectaccess.h"
146145

147146
#include "machine_learning.h"
148147
//#include "storage.h"
@@ -226,7 +225,6 @@ extern int njoins;
226225
/* AQO Memory contexts */
227226
extern MemoryContext AQOTopMemCtx;
228227
extern MemoryContext AQOCacheMemCtx;
229-
extern MemoryContext AQOUtilityMemCtx;
230228
extern MemoryContext AQOPredictMemCtx;
231229
extern MemoryContext AQOLearnMemCtx;
232230

@@ -300,10 +298,5 @@ extern void selectivity_cache_clear(void);
300298

301299
extern bool IsQueryDisabled(void);
302300

303-
extern void aqo_drop_access_hook(ObjectAccessType access, Oid classId,
304-
Oid objectId, int subId, void *arg);
305-
extern void aqo_bgworker_startup(void);
306-
extern PGDLLEXPORT void aqo_bgworker_cleanup(void);
307-
308301
extern List *cur_classes;
309302
#endif

0 commit comments

Comments
 (0)