Hi,
DB2, Sql Server and Oracle have a smart optimization sql-clause (DB2
example):
SELECT * FROM <table> WHERE <cond> ORDER BY <order> OPTMIZATION FOR n ROWS
The [OPTMIZATION FOR] clause turns the query fast by optimize the first "n"
rows.
If the query returns more than "n" rows, the query is slowest if compared
with a normal
query, but it does not have the limitation of PostgreSQL's LIMIT clause.
I think that clause performs the search twice: one for optimize and other if
the # of rows
is great then "n".
It's possible to include this in future releases of PostgreSQL ????
Thanks all! // ...do not attemp to my harmless english... :)
Alexandre Arruda Paes