Re: Query planner issue with preferring primary key over a better index when using ORDER BY and LIMIT - Mailing list pgsql-general

From Mladen Gogala
Subject Re: Query planner issue with preferring primary key over a better index when using ORDER BY and LIMIT
Date
Msg-id bd16c72f-fb80-ed53-eea6-197f33e86362@gmail.com
Whole thread Raw
In response to Re: Query planner issue with preferring primary key over a better index when using ORDER BY and LIMIT  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-general
On 12/6/21 22:16, Laurenz Albe wrote:
> An ugly alternative is to use "ORDER BY id + 0", which prevents PostgreSQL
> from using the index.

That was actually the earliest form of Oracle hints. I remember doing 
exactly that in Oracle 5.1.22 on VAX/VMS.

-- 
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com




pgsql-general by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Query planner issue with preferring primary key over a better index when using ORDER BY and LIMIT
Next
From: Peter Eisentraut
Date:
Subject: Re: Are Foreign Key Disabled During Logical Replication Initial Sync?