From: Taral <taral@mail.utexas.edu>
To: Bruce Momjian <maillist@candle.pha.pa.us>
To: Thomas G. Lockhart <lockhart@alumni.caltech.edu>
Cc: jwieck@debis.com
Cc: eric@linux-hw.com
Cc: jeff@remapcorp.com
Cc: hackers@postgreSQL.org
Subject: RE: [HACKERS] What about LIMIT in SELECT ?
Date: Wed, 14 Oct 1998 12:56:00 -0500
Message-ID: <000001bdf79b$e75d87e0$3b291f0a@taral> (raw)
In-Reply-To: <199810141721.NAA28746@candle.pha.pa.us>
> Thomas is correct on this. Vadim has run some tests, and with our
> optimized psort() code, the in-memory sort is often faster than using
> the index to get the tuple, because you are jumping all over the drive.
> I don't remember, but obviously there is a break-even point where
> getting X rows using the index on a table of Y rows is faster , but
> getting X+1 rows on a table of Y rows is faster getting all the rows
> sequentailly, and doing the sort.
>
> You would have to pick only certain queries(no joins, index matches
> ORDER BY), take the number of rows requested, and the number of rows
> selected, and figure out if it is faster to use the index, or a
> sequential scan and do the ORDER BY yourself.
Since a sort loads the data into memory anyway, how about speeding up the
sort by using the index? Or does that take up too much memory? (approx 40%
more than the data alone, I think)
TAra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: taral@mail.utexas.edu, maillist@candle.pha.pa.us, lockhart@alumni.caltech.edu, jwieck@debis.com, eric@linux-hw.com, jeff@remapcorp.com, hackers@postgreSQL.org
Subject: Re: [HACKERS] What about LIMIT in SELECT ?
In-Reply-To: <000001bdf79b$e75d87e0$3b291f0a@taral>
References: <199810141721.NAA28746@candle.pha.pa.us> <000001bdf79b$e75d87e0$3b291f0a@taral>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox