pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: legrand legrand <legrand_legrand@hotmail.com>
To: pgsql-hackers@postgresql.org
Subject: Re: [survey] New "Stable" QueryId based on normalized query text
Date: Sat, 10 Aug 2019 13:34:38 -0700 (MST)
Message-ID: <1565469278926-0.post@n3.nabble.com> (raw)
In-Reply-To: <1565400424579-0.post@n3.nabble.com>
References: <0A3221C70F24FB45833433255569204D1FBE20A4@G01JPEXMBYT05>
	<1553110765067-0.post@n3.nabble.com>
	<CAOBaU_ZJShkK40_suw9NtUZEtoM07PYg4c_G2m_=HyXQ+pzoAw@mail.gmail.com>
	<1553116679891-0.post@n3.nabble.com>
	<1553117433667-0.post@n3.nabble.com>
	<CAOBaU_atk6WMxA=ajNURThwmJ2jMyEfkE88TSkwtOfvk4gXrFA@mail.gmail.com>
	<1553120398016-0.post@n3.nabble.com>
	<20190409212613.udbyn2ezioz2clwn@momjian.us>
	<CAOBaU_ZgCPB-N261Gh2+35vakyKHFHcEbCFrCrwST_UEyUjr4w@mail.gmail.com>
	<1565400424579-0.post@n3.nabble.com>

Hi Jim,

Its never too later, as nothing has been concluded about that survey ;o)

For information, I thought It would be possible to get a more stable
QueryId,
by hashing relation name or fully qualified names.

With the support of Julien Rouhaud, I tested with this kind of code:

 	case RTE_RELATION:
			if (pgss_queryid_oid)
				{
					APP_JUMB(rte->relid);
				}
				else
				{
					rel = RelationIdGetRelation(rte->relid);
					APP_JUMB_STRING(RelationGetRelationName(rel));
					APP_JUMB_STRING(get_namespace_name(get_rel_namespace(rte->relid)));
					RelationClose(rel);
				{
				
thinking that 3 hash options would be interesting in pgss:
1- actual OID
2- relation names only (for databases WITHOUT distinct schemas contaning
same tables)
3- fully qualified names schema.relname (for databases WITH distinct schemas
contaning same tables)

but performances where quite bad (it was a few month ago, but I remenber
about a 1-5% decrease).
I also remenber that's this was not portable between distinct pg versions
11/12
and also not sure it was stable between windows / linux ports ...

So I stopped here ... Maybe its time to test deeper this alternative 
(to get fully qualified names hashes in One call) knowing that such
transformations 
will have to be done for all objects types (not only relations) ?

I'm ready to continue testing as it seems the less impacting solution to
keep actual pgss ...

If this doesn't work, then trying with a normalized query text (associated
with search_path) would be the 
other alternative, but impacts on actual pgss would be higher ... 

Regards
PAscal





--
Sent from: https://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html





view thread (26+ messages)  latest in thread

Message-ID: <1565469278926-0.post@n3.nabble.com>
Permalink:  ../1565469278926-0.post@n3.nabble.com/
Also on:    postgresql.org/message-id/1565469278926-0.post@n3.nabble.com

 · 

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: pgsql-hackers@postgresql.org
  Cc: legrand_legrand@hotmail.com
  Subject: Re: [survey] New "Stable" QueryId based on normalized query text
  In-Reply-To: <1565469278926-0.post@n3.nabble.com>

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

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