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

Commit748f28a

Browse files
author
Alexandra Pervushina
committed
remove seqscan in load_aqo_data,
remove info about neighbours from aqo_data
1 parent2ba780e commit748f28a

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

‎aqo--1.4--1.5.sql‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ CREATE FUNCTION aqo_data (
6161
OUT featuresdouble precision[][],
6262
OUT targetsdouble precision[],
6363
OUT reliabilitydouble precision[],
64-
OUT oidsOid[],
65-
OUT prev_fsbigint,
66-
OUT next_fsbigint
64+
OUT oidsOid[]
6765
)
6866
RETURNS SETOF record
6967
AS'MODULE_PATHNAME','aqo_data'

‎storage.c‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ typedef enum {
5252

5353
typedefenum {
5454
AD_FS=0,AD_FSS,AD_NFEATURES,AD_FEATURES,AD_TARGETS,AD_RELIABILITY,
55-
AD_OIDS,AD_PREV_FS,AD_NEXT_FS,AD_TOTAL_NCOLS
55+
AD_OIDS,AD_TOTAL_NCOLS
5656
}aqo_data_cols;
5757

5858
typedefenum {
@@ -1580,17 +1580,18 @@ load_aqo_data(uint64 fs, int fss, OkNNrdata *data, List **reloids,
15801580
else
15811581
/* Iterate across all elements of the table. XXX: Maybe slow. */
15821582
{
1583-
HASH_SEQ_STATUShash_seq;
1584-
intnoids=-1;
1583+
intnoids=-1;
1584+
NeighboursEntry*neighbour_entry;
15851585

15861586
found= false;
1587-
// TODO replace with hash
1588-
hash_seq_init(&hash_seq,data_htab);
1589-
while ((entry=hash_seq_search(&hash_seq))!=NULL)
1587+
neighbour_entry= (NeighboursEntry*)hash_search(fss_neighbours,&fss,HASH_FIND,&found);
1588+
entry=found ?neighbour_entry->data :NULL;
1589+
1590+
while (entry!=NULL)
15901591
{
15911592
List*tmp_oids=NIL;
15921593

1593-
if (entry->key.fss!=fss||entry->cols!=data->cols)
1594+
if (entry->cols!=data->cols)
15941595
continue;
15951596

15961597
temp_data=_fill_knn_data(entry,&tmp_oids);
@@ -1615,7 +1616,8 @@ load_aqo_data(uint64 fs, int fss, OkNNrdata *data, List **reloids,
16151616
list_free(tmp_oids);
16161617

16171618
build_knn_matrix(data,temp_data);
1618-
found= true;
1619+
1620+
entry=entry->list.prev;
16191621
}
16201622
}
16211623

@@ -1679,8 +1681,6 @@ aqo_data(PG_FUNCTION_ARGS)
16791681
values[AD_FS]=Int64GetDatum(entry->key.fs);
16801682
values[AD_FSS]=Int32GetDatum((int)entry->key.fss);
16811683
values[AD_NFEATURES]=Int32GetDatum(entry->cols);
1682-
values[AD_PREV_FS]=Int64GetDatum(entry->list.prev);
1683-
values[AD_NEXT_FS]=Int64GetDatum(entry->list.next);
16841684

16851685
/* Fill values from the DSA data chunk */
16861686
Assert(DsaPointerIsValid(entry->data_dp));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp