Subject | Cursors |
---|---|
Author | Miroslav Halas |
Post date | 2004-06-05T00:22:16Z |
Hello,
I got suggestion from Firebird-Java group to contact you guys for an
opinion.
My question was if you can suggest solution if I have table with let say
100,000 records and I want to display record 50,000 - 50,010? How to do
it effectively and fast?
The responses so far I got were that 1.5RC3 driver can do this by
caching the whole resultset on the client which is of course unfeasable
for large data set. Another suggestion I got was:
"Most effective would be SELECT FIRST 10 SKIP 50000 * FROM myTable, but
that would cause server to fetch first 50,000 records and just throw
them away. The most effective would be - do not use such feature until
Firebird provides scrollable cursors"
This is of course not an option for us so do you have any other suggestion?
Thanks in advance,
Miro Halas
-------- Original Message --------
Subject: Re: Cursors
Date: 6/4/2004, 9:03 AM
From: Roman Rokytskyy <rrokytskyy@...>
To: Miroslav Halas <firebird@...>
would cause server to fetch first 50,000 records and just throw them away.
The most effective would be - do not use such feature until Firebird
provides scrollable cursors. Most likely your table has some key (surrogate
PK, timestamp, etc), use SELECT * FROM myTable WHERE myFilterField
BETWEEN ?
AND ?, in this case server can use index. This would be the most effective
for big result sets.
(BTW, you can submit your desire to have them into Firebird-Architect
group,
there's still no consensus among developers whether to try to implement
this
feature or not).
Roman
I got suggestion from Firebird-Java group to contact you guys for an
opinion.
My question was if you can suggest solution if I have table with let say
100,000 records and I want to display record 50,000 - 50,010? How to do
it effectively and fast?
The responses so far I got were that 1.5RC3 driver can do this by
caching the whole resultset on the client which is of course unfeasable
for large data set. Another suggestion I got was:
"Most effective would be SELECT FIRST 10 SKIP 50000 * FROM myTable, but
that would cause server to fetch first 50,000 records and just throw
them away. The most effective would be - do not use such feature until
Firebird provides scrollable cursors"
This is of course not an option for us so do you have any other suggestion?
Thanks in advance,
Miro Halas
-------- Original Message --------
Subject: Re: Cursors
Date: 6/4/2004, 9:03 AM
From: Roman Rokytskyy <rrokytskyy@...>
To: Miroslav Halas <firebird@...>
> can you then suggest solution if I have table with let say 100,000Most effective would be SELECT FIRST 10 SKIP 50000 * FROM myTable, but that
> records and I want to display record 50,000 - 50,010? How to do it
> effectively and fast?
would cause server to fetch first 50,000 records and just throw them away.
The most effective would be - do not use such feature until Firebird
provides scrollable cursors. Most likely your table has some key (surrogate
PK, timestamp, etc), use SELECT * FROM myTable WHERE myFilterField
BETWEEN ?
AND ?, in this case server can use index. This would be the most effective
for big result sets.
(BTW, you can submit your desire to have them into Firebird-Architect
group,
there's still no consensus among developers whether to try to implement
this
feature or not).
Roman