pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Klaudie Willis <Klaudie.Willis@protonmail.com>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: PostgreSQL General <pgsql-general@lists.postgresql.org>
Subject: Re: Bitmap scan seem like such a strange choice when "limit 1"
Date: Fri, 04 Sep 2020 10:41:21 -0400
Message-ID: <874451.1599230481@sss.pgh.pa.us> (raw)
In-Reply-To: <dtW7dvsuov1mKu9LRywm0_Ax00ES--hEviwZsEMkAJ5l-Q60eWXLTJaKEoXCHfPYYvboJpn1Ig785HAB_6R3dDrneO-_pAtFYwTZx3nTdjI=@protonmail.com>
References: <X5rHjtT8gkMBFiaErcYyqD2R3r887Zxd9s15EutKCF2DxNxrxjm_JNp4YDyF-ANfXOr-xf-6PKoY5Lfq0X468FGrTJIh_KUaM4pXw8sum1s=@protonmail.com>
	<a3d7ed35f09992174c968ff809e89ecc7fbb95f9.camel@cybertec.at>
	<dtW7dvsuov1mKu9LRywm0_Ax00ES--hEviwZsEMkAJ5l-Q60eWXLTJaKEoXCHfPYYvboJpn1Ig785HAB_6R3dDrneO-_pAtFYwTZx3nTdjI=@protonmail.com>

Klaudie Willis <Klaudie.Willis@protonmail.com> writes:
> I'd like to add, that when I do the same query DIRECTLY on the bigtable_y2020 (instead of the partition parent) it does change to "index scan" again.

Yeah.  I think the issue here is that add_paths_to_append_rel only
considers cheapest-total paths for the member relations.  Seeing
that it's already considering a slightly ridiculous number of
parallelization options, I'm hesitant to throw in cheapest-startup
considerations as well, for fear of blowing out planning time.

Maybe the right way to improve this is to bypass add_paths_to_append_rel
entirely when there's exactly one surviving child rel, and make it
just use all the surviving paths for that child.

			regards, tom lane





view thread (7+ messages)  latest in thread

Message-ID: <874451.1599230481@sss.pgh.pa.us>
Permalink:  ../874451.1599230481@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/874451.1599230481@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, Klaudie.Willis@protonmail.com, laurenz.albe@cybertec.at
  Subject: Re: Bitmap scan seem like such a strange choice when "limit 1"
  In-Reply-To: <874451.1599230481@sss.pgh.pa.us>
  References: <X5rHjtT8gkMBFiaErcYyqD2R3r887Zxd9s15EutKCF2DxNxrxjm_JNp4YDyF-ANfXOr-xf-6PKoY5Lfq0X468FGrTJIh_KUaM4pXw8sum1s=@protonmail.com> <a3d7ed35f09992174c968ff809e89ecc7fbb95f9.camel@cybertec.at> <dtW7dvsuov1mKu9LRywm0_Ax00ES--hEviwZsEMkAJ5l-Q60eWXLTJaKEoXCHfPYYvboJpn1Ig785HAB_6R3dDrneO-_pAtFYwTZx3nTdjI=@protonmail.com> <874451.1599230481@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