@@ -254,7 +254,7 @@ InsertTuples(Relation index, IvfflatBuildState * buildstate, ForkNumber forkNum)
254
254
IndexTuple itup = NULL ; /* silence compiler warning */
255
255
int64 inserted = 0 ;
256
256
257
- TupleTableSlot * slot = MakeSingleTupleTableSlot (buildstate -> tupdesc , & TTSOpsMinimalTuple );
257
+ TupleTableSlot * slot = MakeSingleTupleTableSlot (buildstate -> sortdesc , & TTSOpsMinimalTuple );
258
258
TupleDesc tupdesc = RelationGetDescr (index );
259
259
260
260
pgstat_progress_update_param (PROGRESS_CREATEIDX_SUBPHASE , PROGRESS_IVFFLAT_PHASE_LOAD );
@@ -356,12 +356,12 @@ InitBuildState(IvfflatBuildState * buildstate, Relation heap, Relation index, In
356
356
errmsg ("dimensions must be greater than one for this opclass" )));
357
357
358
358
/* Create tuple description for sorting */
359
- buildstate -> tupdesc = CreateTemplateTupleDesc (3 );
360
- TupleDescInitEntry (buildstate -> tupdesc , (AttrNumber ) 1 , "list" , INT4OID , -1 , 0 );
361
- TupleDescInitEntry (buildstate -> tupdesc , (AttrNumber ) 2 , "tid" , TIDOID , -1 , 0 );
362
- TupleDescInitEntry (buildstate -> tupdesc , (AttrNumber ) 3 , "vector" , RelationGetDescr (index )-> attrs [0 ].atttypid , -1 , 0 );
359
+ buildstate -> sortdesc = CreateTemplateTupleDesc (3 );
360
+ TupleDescInitEntry (buildstate -> sortdesc , (AttrNumber ) 1 , "list" , INT4OID , -1 , 0 );
361
+ TupleDescInitEntry (buildstate -> sortdesc , (AttrNumber ) 2 , "tid" , TIDOID , -1 , 0 );
362
+ TupleDescInitEntry (buildstate -> sortdesc , (AttrNumber ) 3 , "vector" , RelationGetDescr (index )-> attrs [0 ].atttypid , -1 , 0 );
363
363
364
- buildstate -> slot = MakeSingleTupleTableSlot (buildstate -> tupdesc , & TTSOpsVirtual );
364
+ buildstate -> slot = MakeSingleTupleTableSlot (buildstate -> sortdesc , & TTSOpsVirtual );
365
365
366
366
buildstate -> centers = VectorArrayInit (buildstate -> lists , buildstate -> dimensions , buildstate -> typeInfo -> itemSize (buildstate -> dimensions ));
367
367
buildstate -> listInfo = palloc (sizeof (ListInfo ) * buildstate -> lists );
@@ -633,7 +633,7 @@ IvfflatParallelScanAndSort(IvfflatSpool * ivfspool, IvfflatShared * ivfshared, S
633
633
InitBuildState (& buildstate , ivfspool -> heap , ivfspool -> index , indexInfo );
634
634
memcpy (buildstate .centers -> items , ivfcenters , buildstate .centers -> itemsize * buildstate .centers -> maxlen );
635
635
buildstate .centers -> length = buildstate .centers -> maxlen ;
636
- ivfspool -> sortstate = InitBuildSortState (buildstate .tupdesc , sortmem , coordinate );
636
+ ivfspool -> sortstate = InitBuildSortState (buildstate .sortdesc , sortmem , coordinate );
637
637
buildstate .sortstate = ivfspool -> sortstate ;
638
638
scan = table_beginscan_parallel (ivfspool -> heap ,
639
639
ParallelTableScanFromIvfflatShared (ivfshared ));
@@ -950,7 +950,7 @@ AssignTuples(IvfflatBuildState * buildstate)
950
950
}
951
951
952
952
/* Begin serial/leader tuplesort */
953
- buildstate -> sortstate = InitBuildSortState (buildstate -> tupdesc , maintenance_work_mem , coordinate );
953
+ buildstate -> sortstate = InitBuildSortState (buildstate -> sortdesc , maintenance_work_mem , coordinate );
954
954
955
955
/* Add tuples to sort */
956
956
if (buildstate -> heap != NULL )
0 commit comments