Re: Custom base type and suboptimal query plans

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ayo <ayo(at)blicky(dot)net>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Custom base type and suboptimal query plans
Date: 2021-02-23 17:20:34
Message-ID: 3873892.1614100834@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ayo <ayo(at)blicky(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2021-02-23 17:34:04 Re: pg_restore - generated column - not populating
Previous Message Santosh Udupi 2021-02-23 17:18:00 Re: pg_restore - generated column - not populating