Re: LIMIT Optimization

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: LIMIT Optimization
Дата
Msg-id 200201251732.g0PHWrd27513@candle.pha.pa.us
обсуждение исходный текст
Ответ на LIMIT Optimization  ("alexandre paes :: aldeia digital" <alepaes@aldeiadigital.com.br>)
Ответы Re: LIMIT Optimization  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: LIMIT Optimization  (Oleg Bartunov <oleg@sai.msu.su>)
Список pgsql-sql
alexandre paes :: aldeia digital wrote:
> 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 ????

So it forces our LIMIT optimization, without limiting the number of rows
returned.  That seems to be of questionable value.  The only value I can
see for it is for CURSOR queries but I don't think we can start
returning rows from even a cursor until the entire query is done
executing.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


В списке pgsql-sql по дате отправления:

Предыдущее
От: Arve Fahlvik
Дата:
Сообщение: Complex column ref.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: LIMIT Optimization