Skip to content

Commit 6722110

Browse files
authored
revert: fix: Inaccurate table total row count for PostgreSQL
This reverts commit 0823a02.
1 parent 6c5f89a commit 6722110

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Adapters/Storage/Postgres/PostgresStorageAdapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2040,7 +2040,7 @@ export class PostgresStorageAdapter implements StorageAdapter {
20402040
if (where.pattern.length > 0 || !estimate) {
20412041
qs = `SELECT count(*) FROM $1:name ${wherePattern}`;
20422042
} else {
2043-
qs = 'SELECT n_live_tup AS approximate_row_count FROM pg_stat_all_tables WHERE relname = $1;';
2043+
qs = 'SELECT reltuples AS approximate_row_count FROM pg_class WHERE relname = $1';
20442044
}
20452045
20462046
return this._client

0 commit comments

Comments
 (0)