Skip to content

Commit b1d59e4

Browse files
lss602726449my-ship-it
authored andcommitted
Fix: if tableam implement relation_acquire_sample_rows, then just use it
1 parent c962f92 commit b1d59e4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/backend/commands/analyze.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,9 +1643,13 @@ gp_acquire_sample_rows_func(Relation onerel, int elevel,
16431643
totalrows, totaldeadrows);
16441644
}
16451645

1646-
if (RelationIsAppendOptimized(onerel))
1646+
/*
1647+
* if relation_acquire_sample_rows exist, we use it directly.
1648+
* Otherwise, use the acquire_sample_rows by default.
1649+
*/
1650+
if (onerel->rd_tableam->relation_acquire_sample_rows)
16471651
return table_relation_acquire_sample_rows(onerel, elevel, rows,
1648-
targrows, totalrows, totaldeadrows);
1652+
targrows, totalrows, totaldeadrows);
16491653

16501654
return acquire_sample_rows(onerel, elevel, rows,
16511655
targrows, totalrows, totaldeadrows);

0 commit comments

Comments
 (0)