Discussion:
[ADMIN] cancelled queries on standby
(too old to reply)
MirrorX
2011-11-15 10:46:43 UTC
Permalink
hello to all,

i am facing an issue concerning cancelled queries made on a hot standby
server. if we suppose that there are some tables that are never changed (no
inserts/updates/deletes) and that autovacuum is set to false for these
tables, what else could there be affecting these tables and consequently
cancelling my queries? thx in advance for any suggestions

--
View this message in context: http://postgresql.1045698.n5.nabble.com/cancelled-queries-on-standby-tp4994025p4994025.html
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
--
Sent via pgsql-admin mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Greg Smith
2011-11-15 20:38:58 UTC
Permalink
Post by MirrorX
i am facing an issue concerning cancelled queries made on a hot standby
server. if we suppose that there are some tables that are never changed (no
inserts/updates/deletes) and that autovacuum is set to false for these
tables, what else could there be affecting these tables and consequently
cancelling my queries? thx in advance for any suggestions
Query cancellation isn't targeted this way. Whether or not a query
needs to be canceled by vacuum cleanup depends on whether any open
transaction can see the rows that are being cleaned up. I think you
have the understandable belief what rows are actually being viewed by
the query running on the standby matter; they don't.

Let's say you have a long-running query Q accessing a table A on the
standby. Then some vacuum cleanup of table B happens on the master. Q
can then be canceled when those cleanup records are replicated. The
fact that A is never changed and doesn't have autovacuum enabled doesn't
matter. Because it's possible for Q to see B, it's canceled regardless
of whether it's looked at it yet.
--
Greg Smith 2ndQuadrant US ***@2ndQuadrant.com Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us
--
Sent via pgsql-admin mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
MirrorX
2011-11-15 22:09:28 UTC
Permalink
thanks a lot. the way it works is crystal clear to me now

--
View this message in context: http://postgresql.1045698.n5.nabble.com/cancelled-queries-on-standby-tp4994025p4995933.html
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
--
Sent via pgsql-admin mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Loading...