Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/backend/access/table/tableam.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,11 @@ table_index_fetch_tuple_check(Relation rel,
bool found;

/*
* Optimized path for AO/CO relations as the aforementioned per-tuple
* overhead is significant for AO/CO relations. For details, please refer to
* Optimized path for non-heap relations as the aforementioned per-tuple
* overhead is significant for non-heap relations. For details, please refer to
* table_index_unique_check().
*/
if (RelationIsAppendOptimized(rel))
if (rel->rd_tableam->index_unique_check)
Comment thread
my-ship-it marked this conversation as resolved.
return table_index_unique_check(rel, tid, snapshot, all_dead);

slot = table_slot_create(rel, NULL);
Expand Down
13 changes: 12 additions & 1 deletion src/backend/executor/nodeBitmapHeapscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ static inline void BitmapPrefetch(BitmapHeapScanState *node,
static bool BitmapShouldInitializeSharedState(ParallelBitmapHeapState *pstate);
static void ExecEagerFreeBitmapHeapScan(BitmapHeapScanState *node);

/*
* Other non-heap table access method may use bitmap scan,
* the prefetch will not work for them if they have
* non-standard page-based storage.
*/
static inline bool
RelationSupportPrefetch(Relation rel)
{
return RelationIsHeap(rel);
}

/*
* Free the state relevant to bitmaps
Expand Down Expand Up @@ -325,7 +335,8 @@ BitmapHeapNext(BitmapHeapScanState *node)
* XXX: It's a layering violation that we do these checks above
* tableam, they should probably moved below it at some point.
*/
BitmapPrefetch(node, scan);
if (RelationSupportPrefetch(scan->rs_rd))
BitmapPrefetch(node, scan);

if (node->return_empty_tuples > 0)
{
Expand Down