Обсуждение: cancelled queries on standby

Поиск
Список
Период
Сортировка

cancelled queries on standby

От
MirrorX
Дата:
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.

Re: cancelled queries on standby

От
Greg Smith
Дата:
On 11/15/2011 05:46 AM, MirrorX wrote:
> 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    greg@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support  www.2ndQuadrant.us


Re: cancelled queries on standby

От
MirrorX
Дата:
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.