Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3bd2bb3

Browse files
committed
Slightly refactor patch on query max size.
1 parenta81afb6 commit3bd2bb3

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

‎aqo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,10 @@ _PG_init(void)
253253
NULL
254254
);
255255

256-
DefineCustomIntVariable("aqo.max_size",
256+
DefineCustomIntVariable("aqo.querytext_max_size",
257257
"Query max size in aqo_query_texts.",
258258
NULL,
259-
&max_size,
259+
&querytext_max_size,
260260
1000,
261261
0,INT_MAX,
262262
PGC_SUSET,

‎aqo_shared.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ HTAB *fss_htab = NULL;
2828
staticintaqo_htab_max_items=1000;
2929
intfs_max_items=1;/* Max number of different feature spaces in ML model */
3030
intfss_max_items=1;/* Max number of different feature subspaces in ML model */
31-
intmax_size=1000;
3231
staticuint32temp_storage_size=1024*1024*10;/* Storage size, in bytes */
3332
staticdsm_segment*seg=NULL;
3433

‎aqo_shared.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ extern HTAB *fss_htab;
5252

5353
externintfs_max_items;/* Max number of feature spaces that AQO can operate */
5454
externintfss_max_items;
55-
externintmax_size;
55+
externintquerytext_max_size;
5656

5757
externSizeaqo_memsize(void);
5858
externvoidreset_dsm_cache(void);

‎storage.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ typedef void* (*form_record_t) (void *ctx, size_t *size);
6464
typedefvoid (*deform_record_t) (void*data,size_tsize);
6565

6666

67+
intquerytext_max_size=1000;
68+
6769
HTAB*stat_htab=NULL;
6870
HTAB*queries_htab=NULL;
6971
HTAB*qtexts_htab=NULL;
@@ -934,7 +936,7 @@ aqo_qtext_store(uint64 queryid, const char *query_string)
934936

935937
Assert(!LWLockHeldByMe(&aqo_state->qtexts_lock));
936938

937-
if (query_string==NULL)
939+
if (query_string==NULL||querytext_max_size==0)
938940
return false;
939941

940942
dsa_init();
@@ -969,7 +971,7 @@ aqo_qtext_store(uint64 queryid, const char *query_string)
969971
}
970972

971973
entry->queryid=queryid;
972-
size=size>max_size ?max_size :size;
974+
size=size>querytext_max_size ?querytext_max_size :size;
973975
entry->qtext_dp=dsa_allocate(qtext_dsa,size);
974976
Assert(DsaPointerIsValid(entry->qtext_dp));
975977
strptr= (char*)dsa_get_address(qtext_dsa,entry->qtext_dp);
@@ -1641,7 +1643,7 @@ aqo_queries(PG_FUNCTION_ARGS)
16411643
while ((entry=hash_seq_search(&hash_seq))!=NULL)
16421644
{
16431645
memset(nulls,0,AQ_TOTAL_NCOLS+1);
1644-
1646+
16451647
values[AQ_QUERYID]=Int64GetDatum(entry->queryid);
16461648
values[AQ_FS]=Int64GetDatum(entry->fs);
16471649
values[AQ_LEARN_AQO]=BoolGetDatum(entry->learn_aqo);

‎storage.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ typedef struct QueriesEntry
8282
boolauto_tuning;
8383
}QueriesEntry;
8484

85+
externintquerytext_max_size;
86+
8587
externHTAB*stat_htab;
8688
externHTAB*qtexts_htab;
8789
externHTAB*queries_htab;/* TODO */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp