pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ayo <ayo@blicky.net>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Custom base type and suboptimal query plans
Date: Tue, 23 Feb 2021 12:20:34 -0500
Message-ID: <3873892.1614100834@sss.pgh.pa.us> (raw)
In-Reply-To: <YDUow/TOMox1g9TU@gmai021>
References: <YDUIvp3QiXjjHPkz@gmai021>
	<3822526.1614093860@sss.pgh.pa.us>
	<YDUow/TOMox1g9TU@gmai021>

Ayo <ayo@blicky.net> writes:
> On 2021-02-23, Tom Lane wrote:
>> The slow query isn't using the chars_pkey1 index, which makes one
>> wonder if you have a corresponding index in the custom-type case,

> The index exists and is usable in the custom-type case:

Hmm.  The next most likely theory seems to be something wrong with
cost estimation, causing the planner to avoid the nestloop-with-
inner-indexscan plan even though it would work.  Have you tried
"enable_seqscan = off" (and maybe also disable merge and hash joins)
to see if you can force choice of that plan?

			regards, tom lane





view thread (8+ messages)  latest in thread

Message-ID: <3873892.1614100834@sss.pgh.pa.us>
Permalink:  ../3873892.1614100834@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3873892.1614100834@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, ayo@blicky.net
  Subject: Re: Custom base type and suboptimal query plans
  In-Reply-To: <3873892.1614100834@sss.pgh.pa.us>
  References: <YDUIvp3QiXjjHPkz@gmai021> <3822526.1614093860@sss.pgh.pa.us> <YDUow/TOMox1g9TU@gmai021> <3873892.1614100834@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