Re: [SQL] trivial problem

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [SQL] trivial problem
Дата
Msg-id 199910300019.UAA24998@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: [SQL] trivial problem  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
> Bruce Momjian <maillist@candle.pha.pa.us> writes:
> > FAQ says:
> > See the <I>fetch</I> manual page, or use SELECT ... LIMIT....<P>
> 
> > This only prevents all row results from being transferred to the client.
> > The entire query must be evaluated, even if you only want just the first
> > few rows. Consider a query that has an <I>order by.</I>  There is no way
> > to return any rows until the entire query is evaluated and sorted.<P>
> 
> That FAQ entry is not right.  It might be right for FETCH, but not for
> SELECT ... LIMIT.  With a LIMIT, the executor will stop once it has
> generated the requested number of rows.  Of course, how much computation
> is needed to reach that point depends greatly on the query and the query
> plan.

New FAQ text is:
  The entire query may have to be evaluated, even if you only want the  first few rows. Consider a query that has an
ORDERBY. If there is an  index that matches the ORDER BY, PostgreSQL may be able to evaluate  only the first few
recordsrequested, or the entire query may have to  be evaluated until the desired rows have been generated.  
 

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@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 по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [SQL] Decimal precsion?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [SQL] Decimal precsion?