@@ -1586,7 +1586,8 @@ load_aqo_data(uint64 fs, int fss, OkNNrdata *data, List **reloids,
15861586
15871587found = false;
15881588LWLockAcquire (& aqo_state -> neighbours_lock ,LW_EXCLUSIVE );
1589- neighbour_entry = (NeighboursEntry * )hash_search (fss_neighbours ,& fss ,HASH_FIND ,& found );
1589+ neighbour_entry = (NeighboursEntry * )hash_search (fss_neighbours ,& key .fss ,HASH_FIND ,& found );
1590+ // elog(NOTICE, "neighbours num %ld", hash_get_num_entries(fss_neighbours));
15901591entry = found ?neighbour_entry -> data :NULL ;
15911592
15921593/*
@@ -1595,10 +1596,10 @@ load_aqo_data(uint64 fs, int fss, OkNNrdata *data, List **reloids,
15951596while (entry != NULL )
15961597{
15971598List * tmp_oids = NIL ;
1598-
1599+ elog ( NOTICE , "ЗАШЛИ К СОСЕДЯМ entry %d data %d" , entry -> cols , data -> cols );
15991600if (entry -> cols != data -> cols )
16001601continue ;
1601-
1602+ elog ( NOTICE , "Я нашел соседа fss %d" , fss );
16021603temp_data = _fill_knn_data (entry ,& tmp_oids );
16031604
16041605if (data -> rows > 0 && list_length (tmp_oids )!= noids )
@@ -2109,7 +2110,7 @@ _deform_neighbours_record_cb(void *data, size_t size)
21092110
21102111fss = ((NeighboursEntry * )data )-> fss ;
21112112entry = (NeighboursEntry * )hash_search (fss_neighbours ,& fss ,HASH_ENTER ,& found );
2112- Assert (!found );
2113+ Assert (!found && entry );
21132114memcpy (entry ,data ,sizeof (NeighboursEntry ));
21142115return true;
21152116}
@@ -2121,13 +2122,8 @@ aqo_neighbours_load(void)
21212122
21222123LWLockAcquire (& aqo_state -> neighbours_lock ,LW_EXCLUSIVE );
21232124
2124- if (hash_get_num_entries (fss_neighbours )!= 0 )
2125- {
2126- /* Someone have done it concurrently. */
2127- elog (LOG ,"[AQO] Another backend have loaded neighbours data concurrently." );
2128- LWLockRelease (& aqo_state -> neighbours_lock );
2129- return ;
2130- }
2125+ /* Load on postmaster sturtup. So no any concurrent actions possible here. */
2126+ Assert (hash_get_num_entries (fss_neighbours )== 0 );
21312127
21322128data_load (PGAQO_NEIGHBOURS_FILE ,_deform_neighbours_record_cb ,NULL );
21332129