From: Hiroshi Inoue <Inoue@tpf.co.jp>
To: hackers@postgreSQL.org
Subject: RE: [HACKERS] What about LIMIT in SELECT ?
Date: Thu, 15 Oct 1998 13:52:32 +0900
Message-ID: <000001bdf7f7$9ec5fc40$2801007e@cadzone.tpf.co.jp> (raw)
In-Reply-To: <Pine.GSO.3.96.SK.981013211058.17758A-100000@ra>
Hi all.
I didn't follow all the posts about this thread.
So this post may be out of center.
I think current PostgreSQL lacks the concern to the response to get first
rows quickly.
For example,queries with ORDER BY clause necessarily include sort steps
and process all target rows to get first rows only.
So I modified my code for ORDER BY cases and use on trial.
I don't understand PostgreSQL sources,so my code is not complete.
I modified my code for the following 2 cases.
1.In many cases the following query uses index scan.
SELECT * from ... where key > ...; (where (key) is an index)
If so,we can omit sort steps from the access plan for the following
query.
SELECT * from ... where key > ... order by key;
Currently cursors without sort steps may be sensitive diffrent from
cursors with sort steps. But no one mind it.
2.In many cases the following query uses index scan same as case 1.
SELECT * from ... where key < ...;(where (key) is an index)
If so and if we scan the index backward,we can omit sort steps from
the access plan for the following query.
SELECT * from ... where key < ... order by key desc;
To achive this(backward scan),I used hidden(provided for the future ?)code
that is never executed and is not necessarily correct.
In the following cases I didn't modify my code to use index scan,
because I couldn't formulate how to tell PostgreSQL optimizer whether
the response to get first rows is needed or the throughput to process
sufficiently many target rows is needed.
3.The access plan made by current PostgreSQL optimizer for a query with
ORDER BY clause doesn't include index scan.
I thought the use of Tatsuo's QUERY_LIMIT to decide that the responce
is needed. It is sufficient but not necessary ?
In Oracle the hints FIRST_ROWS,ALL_ROWS are used.
Thanks.
Hiroshi Inoue
Inoue@tpf.co.jp
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: Inoue@tpf.co.jp, hackers@postgreSQL.org
Subject: Re: [HACKERS] What about LIMIT in SELECT ?
In-Reply-To: <000001bdf7f7$9ec5fc40$2801007e@cadzone.tpf.co.jp>
References: <Pine.GSO.3.96.SK.981013211058.17758A-100000@ra> <000001bdf7f7$9ec5fc40$2801007e@cadzone.tpf.co.jp>
* 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