pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Jesper Pedersen <jesper.pedersen@redhat.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: POC: converting Lists into arrays
Date: Wed, 17 Jul 2019 10:16:18 -0400
Message-ID: <27721.1563372978@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKJS1f9-p4R_b2__ugSpiJR3h_TRTw4pb+q8jk=yhEhnT5AMYQ@mail.gmail.com>
References: <481.1551390571@sss.pgh.pa.us>
	<24783.1551568303@sss.pgh.pa.us>
	<20190303043424.itzy3ge52xrkpmpr@alap3.anarazel.de>
	<437.1551637744@sss.pgh.pa.us>
	<CA+TgmoZM4c=v0ifR++i09JFtNtnqTq_HkFmbFjwWqbUJffOLmA@mail.gmail.com>
	<12684.1551723095@sss.pgh.pa.us>
	<20190304190612.vgqqsowzkrh22623@alap3.anarazel.de>
	<26464.1551734920@sss.pgh.pa.us>
	<20190304221101.hdg4vj5fo4eewh3b@alap3.anarazel.de>
	<CAKJS1f-pNfoUJrmU8vgD1WrKLqs9WxOVLQ0RpSWu9h6W9RnypA@mail.gmail.com>
	<20190304235402.nod3gbotk2qtd4nh@alap3.anarazel.de>
	<CAKJS1f-yS201hAAmnxcLb2aeTYNZ_A9R1JNXF6hTVXjhHYN7rQ@mail.gmail.com>
	<1131.1551746172@sss.pgh.pa.us>
	<14626.1558745627@sss.pgh.pa.us>
	<29297.1558799327@sss.pgh.pa.us>
	<f078ce63-9e04-0f3e-d200-d7ee66279abe@redhat.com>
	<25178.1562006685@sss.pgh.pa.us>
	<25258.1562023641@sss.pgh.pa.us>
	<CAKJS1f9RUaLrujzpqf15gg_7Wo9-ai7b3-MR=bMH7a-pOWdeZA@mail.gmail.com>
	<2305.1562181615@sss.pgh.pa.us>
	<21272.1563318411@sss.pgh.pa.us>
	<CAKJS1f9-p4R_b2__ugSpiJR3h_TRTw4pb+q8jk=yhEhnT5AMYQ@! mail.gmail.com>

David Rowley <david.rowley@2ndquadrant.com> writes:
> I've only looked at 0002. Here are my thoughts:

Thanks for looking!

> get_tables_to_cluster:
> Looks fine. It's a heap scan. Any previous order was accidental, so if
> it causes issues then we might need to think of using a more
> well-defined order for CLUSTER;

Check.

> get_rels_with_domain:
> This is a static function. Changing the order of the list seems to
> only really affect the error message that a failed domain constraint
> validation could emit. Perhaps this might break someone else's tests,
> but they should just be able to update their expected results.

Also, this is already dependent on the order of pg_depend entries,
so it's not terribly stable anyhow.

> get_relation_statistics:
> RelationGetStatExtList does not seem to pay much attention to the
> order it returns its results, so I don't think the order we apply
> extended statistics was that well defined before. We always attempt to
> use the stats with the most matching columns in
> choose_best_statistics(), so I think
> for people to be affected they'd either multiple stats with the same
> sets of columns or a complex clause that equally well matches two sets
> of stats, and in that case the other columns would be matched to the
> other stats later... I'd better check that... erm... actually that's
> not true. I see statext_mcv_clauselist_selectivity() makes no attempt
> to match the clause list to another set of stats after finding the
> first best match. I think it likely should do that.
> estimate_multivariate_ndistinct() seems to have an XXX comment
> mentioning thoughts about the stability of which stats are used, but
> nothing is done.

I figured that (a) this hasn't been around so long that anybody's
expectations are frozen, and (b) if there is a meaningful difference in
results then it's probably incumbent on the extstats code to do better.
That seems to match your conclusions.  But I don't see any regression
test changes from making this change, so at least in simple cases it
doesn't matter.

(As you say, any extstats changes that we conclude are needed should
be a separate patch.)

			regards, tom lane





view thread (130+ messages)  latest in thread

Message-ID: <27721.1563372978@sss.pgh.pa.us>
Permalink:  ../27721.1563372978@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27721.1563372978@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, david.rowley@2ndquadrant.com, jesper.pedersen@redhat.com, andres@anarazel.de, robertmhaas@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: POC: converting Lists into arrays
  In-Reply-To: <27721.1563372978@sss.pgh.pa.us>

* 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