Re: LIMIT clause extremely slow

Christophe Pettus <xof@thebuild.com>

From: Christophe Pettus <xof@thebuild.com>
To: Melzer Kassensysteme <office@melzer-kassen.com>
Cc: pgsql-bugs@lists.postgresql.org
Date: 2023-11-15T17:48:37Z
Lists: pgsql-bugs

> On Nov 15, 2023, at 08:46, Melzer Kassensysteme <office@melzer-kassen.com> wrote:
> 
> SELECT * FROM table WHERE (index1 > 1 OR (index1 = 1 AND index2 > 5)) ORDER BY index1, index2 LIMIT 1

Can you show the output of the query running under EXPLAIN ANALYZE ... ?