Re: BUG #15250: ERROR: could not find pathkey item to sort

From: Sara Pranke <sara(dot)pranke(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15250: ERROR: could not find pathkey item to sort
Date: 2018-06-21 15:05:01
Message-ID: CAEipEPWOMipLWwZ1u4ukg8u0A3ySknhnEE93jxacM6qfL3K6bA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi, Tom!
I will be construct a local lab trying to reproduce this error, because
today occur only in client machine.
At the moment my only default is the memory consumed by the Sort plan,
because when I excluded the clauses I saw in EXPLAIN ANALYZE consuming
memory, the query worked.

Ha, I have one more guest, if PostgreSQL can't access disk memory after
consume or estimate more than available in work_mem, maybe this cause the
error. I don't know, just a guest.
When I reproduce the error in lab I share in here more infos.

Thanks,
Sara

2018-06-20 22:44 GMT-03:00 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:

> =?utf-8?q?PG_Bug_reporting_form?= <noreply(at)postgresql(dot)org> writes:
> > I have complex queries in large tables that use memory for sorting
> items, we
> > upgrate PostgreSQL from 9.1 to 9.4 and in this version we get this error:
> > 'could not find pathkey item to sort'
>
> That's a fairly common visible symptom for erroneous construction of a
> plan inside the planner. It has nothing directly to do with memory
> consumption, although it's possible that changing work_mem would encourage
> the planner to choose a different plan shape that avoids the bug.
>
> Another likely explanation for the problem appearing and disappearing is
> that it could be sensitive to the current statistics for the table(s)
> the query is on, in which case a background auto-analyze might be enough
> to flip you from the plan shape with the problem to the plan shape
> without.
>
> Anyway, we'd certainly be interested to fix the problem if you can provide
> a self-contained, reproducible test case. I'd suggest trying to generate
> some dummy data that the query fails on.
>
> regards, tom lane
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Rowley 2018-06-21 15:30:25 Re: BUG #15250: ERROR: could not find pathkey item to sort
Previous Message Mario de Frutos Dieguez 2018-06-21 14:46:12 Re: Problem with a "complex" upsert