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

Commit c4a7bcb

Browse files
committed
Merge branch 'PGPROEE10_aqo' into PGPROEE10
2 parents 6a04c41 + 186aa33 commit c4a7bcb

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

contrib/aqo/machine_learning.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,14 @@ OkNNr_predict(int matrix_rows, int matrix_cols,
116116
if (idx[i] != -1)
117117
result += targets[idx[i]] * w[i] / w_sum;
118118

119-
pfree(distances);
120-
pfree(idx);
121-
pfree(w);
122-
123119
/* this should never happen */
124120
if (idx[0] == -1)
125121
return -1;
126122

123+
pfree(distances);
124+
pfree(idx);
125+
pfree(w);
126+
127127
if (result < 0)
128128
result = 0;
129129
return result;

contrib/aqo/storage.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,10 +575,11 @@ init_deactivated_queries_storage(void)
575575
MemSet(&hash_ctl, 0, sizeof(hash_ctl));
576576
hash_ctl.keysize = sizeof(int);
577577
hash_ctl.entrysize = sizeof(int);
578+
hash_ctl.hash = uint32_hash;
578579
deactivated_queries = hash_create("aqo_deactivated_queries",
579580
128, /* start small and extend */
580581
&hash_ctl,
581-
HASH_ELEM);
582+
HASH_ELEM | HASH_FUNCTION);
582583
}
583584

584585
/* Destroys the storage for hash of deactivated queries */

0 commit comments

Comments
 (0)