3 messages in com.mysql.lists.javaReading a database block by block| From | Sent On | Attachments |
|---|---|---|
| Emmanuel CLERC | 29 Oct 2001 02:23 | |
| Ext-...@nokia.com | 29 Oct 2001 02:42 | |
| Mark Matthews | 29 Oct 2001 03:58 |
| Subject: | Reading a database block by block![]() |
|---|---|
| From: | Emmanuel CLERC (emma...@ferma.fr) |
| Date: | 10/29/2001 02:23:59 AM |
| List: | com.mysql.lists.java |
Hi !
I am reading a large database block by block, ie with several queries like:
select * from Alarm limit 0,10000; select * from Alarm limit 10000,10000; select * from Alarm limit 20000,10000; ...
This works fine but I have noticed that the time needed to retrieve the blocks increases with the offset of the "limit" statement.
For instance:
"select * from Alarm limit 0,10000;" is performed in 300 ms "select * from Alarm limit 10000,10000;" is performed in 320 ms "select * from Alarm limit 20000,10000;" is performed in 350 ms
and so on.
The time is roughly a linear function of the offset.
The explanation is, I presume, that MySQL reads more rows than needed.
I would like the time to be constant (independent of the offset).
Is there any solution: adding an index, upgrading the server (I am running an old 3.22.34 server), using another jdbc driver (I am using MM MySQL) ?
Any help will be appreciated.
--
_______________________________________________________________________ Emmanuel CLERC FERMA emma...@ferma.fr 31, chemin du Vieux-Chêne ZIRST tel +33 (0)4 76 61 79 31 38240 MEYLAN fax +33 (0)4 76 61 79 59 FRANCE
_______________________________________________________________________




