At 13:42 02.08.01 -0400, you wrote:
>At 1:07 PM +0200 8/2/01, Joachim Zobel wrote:
>>Hi.
>>
>>One of the really nice features of MySQL (OK, its not a "real" RDBMS, but 
>>who cares:) is LIMIT.
>>
>>Using Oracle I have found it a real pain to display search results in 
>>pages (of eg 20) while using connection pooling. The problem is that you 
>>can not be shure to repeat the same resultset on every page. This gets a 
>>real problem if the queries get expensive and I can't afford sorting 
>>because it destroys first row performance.
>
>You can with a result index.
>
>When your user first gets to the page, dump the rowids and rownums to a 
>result_index table.
>
>
>create table result_index (
>     session_id    number(10),
>     myrowid       varchar(30),
>     myrownum      number(10),
>     mydate        date
>);
>
>insert into result_index select 123456,rowid,rownum,sysdate from your_table;

The problem with this is that it also destroys first row behaviour. When 
the insert has started running i would like to display the first rows.

I am thinking about a solution that only inserts the rows the user has seen 
and repeats the select (excluding these rows) if he wants to see others. I 
just havent found an elegant PL/SQL way to implement this.

Thanx,
Joachim

--
"... ein Geschlecht erfinderischer Zwerge, die fuer alles gemietet werden
koennen."                            - Bertolt Brecht - Leben des Galilei

Reply via email to