mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
Provide a way block-level table AMs could re-use acquire_sample_rows()
While keeping API the same, this commit provides a way for block-level table AMs to re-use existing acquire_sample_rows() by providing custom callbacks for getting the next block and the next tuple. Reported-by: Andres Freund Discussion: https://postgr.es/m/20240407214001.jgpg5q3yv33ve6y3%40awork3.anarazel.de Reviewed-by: Pavel Borisov
This commit is contained in:
@ -1020,6 +1020,19 @@ table_beginscan_tid(Relation rel, Snapshot snapshot)
|
||||
return rel->rd_tableam->scan_begin(rel, snapshot, 0, NULL, NULL, flags);
|
||||
}
|
||||
|
||||
/*
|
||||
* table_beginscan_analyze is an alternative entry point for setting up a
|
||||
* TableScanDesc for an ANALYZE scan. As with bitmap scans, it's worth using
|
||||
* the same data structure although the behavior is rather different.
|
||||
*/
|
||||
static inline TableScanDesc
|
||||
table_beginscan_analyze(Relation rel)
|
||||
{
|
||||
uint32 flags = SO_TYPE_ANALYZE;
|
||||
|
||||
return rel->rd_tableam->scan_begin(rel, NULL, 0, NULL, NULL, flags);
|
||||
}
|
||||
|
||||
/*
|
||||
* End relation scan.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user