Optimizer Hint, to ignore limit and offset in optimizer plan - Mailing list pgsql-sql

From Martin Handsteiner
Subject Optimizer Hint, to ignore limit and offset in optimizer plan
Date
Msg-id VI1PR1001MB1423F5361320BB854708FD2FE8930@VI1PR1001MB1423.EURPRD10.PROD.OUTLOOK.COM
Whole thread Raw
Responses Re: Optimizer Hint, to ignore limit and offset in optimizer plan  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: Optimizer Hint, to ignore limit and offset in optimizer plan  (Bruce Momjian <bruce@momjian.us>)
Re: Optimizer Hint, to ignore limit and offset in optimizer plan  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-sql

Hello,

 

I’m aware, that taking limit and offset into account of optimizer plan is not a bug.

 

Nevertheless it is very often an unwanted feature.

 

As the postgres db has the issue with not supporting cursors over commit/ rollback, it is necessary to use the limit and offset mechanism.

 

The problem now is, with either

  • not always possible to ensure a proper sort (application with sort on header click),
  • and also on complex queries and a lot of data, that will be slow when sorting the result.

 

So if there would be an optimizer hint, that tells the optimizer to ignore limit and offset on generating a plan, it would be perfect.

 

Mainly having the same optimizer plan without looking on limit and offset, the possibitlity of having mixed data is drastically reduced.

 

Is there possibly already an optimizer hint, to trickout the optimizer, and tell him, that I want all the data, even if there is for eg a limit 10 clause in the select?

 

Thanks

  Martin

pgsql-sql by date:

Previous
From: Joseph
Date:
Subject: Re: Persisting Query tabs/contents over restart
Next
From: Pavel Stehule
Date:
Subject: Re: Optimizer Hint, to ignore limit and offset in optimizer plan