Fixed index scan count

This commit is contained in:
Andrew Kane
2023-03-12 12:24:20 -07:00
parent 385b2437a9
commit bb75ce2cf2
3 changed files with 16 additions and 1 deletions

View File

@@ -5,6 +5,7 @@
#include "access/relscan.h"
#include "ivfflat.h"
#include "miscadmin.h"
#include "pgstat.h"
#include "storage/bufmgr.h"
#include "catalog/pg_operator_d.h"
@@ -267,6 +268,9 @@ ivfflatgettuple(IndexScanDesc scan, ScanDirection dir)
{
Datum value;
/* Count index scan for stats */
pgstat_count_index_scan(scan->indexRelation);
/* Safety check */
if (scan->orderByData == NULL)
elog(ERROR, "cannot scan ivfflat index without order");