Re: Sudden database error with COUNT(*) making Query Planner crashes: variable not found in subplan target list

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Jean Landercy - BEEODIVERSITY <jean(dot)landercy(at)beeodiversity(dot)com>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Sudden database error with COUNT(*) making Query Planner crashes: variable not found in subplan target list
Date: 2022-06-07 19:46:50
Message-ID: CAApHDvr-uuK1mTp2fWLq1V=GL5BvhJ09xuszoCso7VWhVF-yEA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 7 Jun 2022 at 19:58, Jean Landercy - BEEODIVERSITY
<jean(dot)landercy(at)beeodiversity(dot)com> wrote:
> Here is the detail of the table (I have anonymized it on SO, this is its real name):

> "logistic_site_location_54ae0166_id" gist (location)

I imagine this is due to the planner choosing an index-only scan on
the above index. A similar problem was reported in [1].

A fix was committed in [2], which appears in 13.7.

You could turn off enable_indexonlyscan until 13.7 is available to you.

David

[1] https://www.postgresql.org/message-id/CAHUie24ddN+pDNw7fkhNrjrwAX=fXXfGZZEHhRuofV_N_ftaSg@mail.gmail.com
[2] https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=0778b24ced8a873b432641001d046d1dde602466

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-06-07 19:53:05 Re: Collation version tracking for macOS
Previous Message Tom Lane 2022-06-07 19:43:32 Re: Collation version tracking for macOS