Re: Create/alter policy and exclusive table lock - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Create/alter policy and exclusive table lock
Date
Msg-id 11913.1579023656@sss.pgh.pa.us
Whole thread Raw
In response to Re: Create/alter policy and exclusive table lock  (Konstantin Knizhnik <k.knizhnik@postgrespro.ru>)
List pgsql-hackers
Konstantin Knizhnik <k.knizhnik@postgrespro.ru> writes:
> But let me ask you one more question: why do we obtaining snapshot twice 
> in exec_simple_query:
> first for analyze (pg_analyze_and_rewrite) and one for execution 
> (PortalStart)?

That would happen anyway if the plan is cached.  If we were to throw away
all plan caching and swear a mighty oath that we'll never put it back,
maybe we could build in a design assumption that planning and execution
use identical snapshots.  I doubt that would lead to a net win though.

Also note that our whole approach to cache invalidation is based on the
assumption that if session A needs to see the effects of session B,
they will be taking conflicting locks.  Otherwise sinval signaling
is not guaranteed to be detected at the necessary times.

            regards, tom lane



pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Use compiler intrinsics for bit ops in hash
Next
From: Tom Lane
Date:
Subject: Re: backup manifests