Closed bart3r closed 5 years ago
Yes. Pgpool-II issues such queries to backend server. But Pgpool-II sends these queries only the first time when the table is accessed, because these query results are cached in pgpool child process local memory and subsequent queries use the cache.
But Pgpool-II child process doesn't share this cache, other connections will issue these queries again.
So far no ways to disable this feature.
Why do you need to do a full row count ?
What's wrong with "full row count"? It scans a system catalog with index. Regardless it uses count(*) or not, it does not do a full scan on the table.
Aggregate (cost=8.30..8.31 rows=1 width=8) (actual time=0.022..0.023 rows=1 loops=1) -> Index Scan using pg_class_oid_index on pg_class c (cost=0.28..8.29 rows=1 width=0) (actual time=0.016..0.016 rows=0 loops=1) Index Cond: (oid = (to_regclass('"designs"'::text))::oid) Filter: (relpersistence = 'u'::"char") Planning Time: 0.247 ms Execution Time: 0.123 ms (6 rows)
Our database server is continually get hit with queries like the following:
SELECT count(*) FROM pg_catalog.pg_class AS c WHERE c.oid = to_regclass('"designs"') AND c.relpersistence = 'u'
I assume this is coming from the pgpool software, as it is checking the status of tables? The problem is that some of these tables are huge and the query takes a long time, putting quite a lot of load on the server.
Is there a config setting to disable these table counts ?