public inbox for [email protected]  
help / color / mirror / Atom feed
From: Andy Fan <[email protected]>
To: [email protected] <[email protected]>
Subject: Why does exec_simple_query requires 2 snapshots
Date: Tue, 18 Feb 2025 11:48:30 +0000
Message-ID: <[email protected]> (raw)


Hi,

When I run "SELECT * FROM pg_class LIMIT 1";  then postgresql
run GetSnapshotData twice, one is

/*
 * Set up a snapshot if parse analysis/planning will need one.
 */
if (analyze_requires_snapshot(parsetree))
{
	PushActiveSnapshot(GetTransactionSnapshot());
	snapshot_set = true;
}


the other one is in PortalStart.

My question is why can't we share the same snapshot for the 2 cases?
parser & planner requires Catalog Snapshot which should be the 
latest one, but in the above case, looks the executor can reuse it as
well. Is there anything I missed?

Thanks

-- 
Best Regards
Andy Fan







view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Why does exec_simple_query requires 2 snapshots
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox