Re: LIMIT Optimization

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
Cc: "alexandre paes :: aldeia digital" <alepaes(at)aldeiadigital(dot)com(dot)br>, pgsql-sql(at)postgresql(dot)org
Subject: Re: LIMIT Optimization
Date: 2002-01-26 23:11:14
Message-ID: 200201262311.g0QNBEN00888@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Oleg Bartunov wrote:
> On Fri, 25 Jan 2002, Bruce Momjian wrote:
>
> > > if I'm not mistaken, it's called partial sorting, when you stop
> > > sorting process after getting desired number of rows specified by LIMIT clause.
> > > it's extremely friendly for web applications, because 90% of users
> > > just read the first page of results. We already discussed this feature
> > > sometime during 7.1 dev and even made very crude patch. In our tests we
> > > got performance win of factor 5-6 ( getting first 100 row from 1mln ).
> > > We hope sometime we'll return to this.
> >
> > But we already have cursor's assuming 10% return. Is allowing that
> > value to be changed using SET an acceptable solution?
>
>
> Bruce, web applicationa are stateless, so forget about cursors.
> I wrote about obvious optimization which is valid for very narrow case,
> but which is widely spreaded.

I am confused. I thought we already did optimization for LIMIT that
assumed you only wanted a few values. Is there something we are missing
there? I thought the disucssion related only to people using cursors
and fetching only some of the data.

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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message postgresql 2002-01-27 00:03:06 interval and timestamp change?
Previous Message fstelpstra@yahoo.com 2002-01-26 21:06:25 Re: PGACCESS installation