Going by explain plans, looks like its taking estimated time into consideration and not executing the query if it thinks its estimated time exceeds statement_timeout. > Seq Scan on tableb (cost=0.00.16.60 rows=260 width=0)ĭoes statement_timeout go by estimated time or by the actual execution time. Pgdb=> explain select count(*) from tableb Īggregate (cost=17.25.17.26 rows=1 width=8) Pgdb=> explain select count(*) from tableb a, tableb b Īggregate (cost=10.86 rows=1 width=8) Pgdb=> explain analyze select count(*) from tableb a, tableb b, tableb c Pgdb=> explain select count(*) from tableb a, tableb b, tableb c Īggregate (cost=264536.11 rows=1 width=8) Pgdb=> select count(*) from tableb a, tableb b, tableb c - timeout Pgdb=> select count(*) from tableb a, tableb b > Parallel Index Only Scan using idx1 on tablea (cost=328.86 rows=31026013 width=0) Imaods=> explain select count(*) from schema.tablea limit 10 pgdb=> select count(*) from schema.tablea limit 10 - huge table timeoutĮRROR: canceling statement due to statement timeout Logged into PSQL as user1, running very short queries comes back but most of the queries (which will complete in few seconds without statement_timeout limit) are timing out, even though the statement_timeout is set to 180s. Usename | usesysid | usecreatedb | usesuper | userepl | usebypassrls | passwd | valuntil | useconfig Pgdb=> select * from pg_user where usename = 'user1' pgdb=> alter user user1 set statement_timeout=600 To avoid long running queries I want to implement statement_time for certain users.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |