LIMIT Optimization - Mailing list pgsql-sql

From alexandre paes :: aldeia digital
Subject LIMIT Optimization
Date
Msg-id 004601c1a5b9$3b344a60$fc01a8c0@aldeiadigital.com.br
Whole thread Raw
Responses Re: LIMIT Optimization
List pgsql-sql
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



pgsql-sql by date:

Previous
From: Achilleus Mantzios
Date:
Subject: Arrays Question
Next
From: "Josh Berkus"
Date:
Subject: Re: linking from SQL Server