liuis / leveldb

Automatically exported from code.google.com/p/leveldb
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Iterator::SeekToFirst happens to be very slow #204

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. after opening a database, create a iterator
2. call iterator->SeekToFirst()
3.

What is the expected output? What do you see instead?

SeekToFirst() should return immediately. But it is blocked for about one 
minute(60 seconds)!

What version of the product are you using? On what operating system?

1.9.0

Please provide any additional information below.

The total amount of data is 60GB, 1800 sst files.

Original issue reported on code.google.com by wuzuy...@gmail.com on 16 Sep 2013 at 4:54

GoogleCodeExporter commented 9 years ago
Do you have many deleted values that have not been compacted?

Original comment by wouter.b...@gmail.com on 16 Sep 2013 at 6:51

GoogleCodeExporter commented 9 years ago
It may have some deleted values. The DB::Open() also takes about one minute to 
finish, I can see from info_log that LevelDB is doing compaction.

When mixing Seek()/SeekToFirst(), Seek() always returns immediately, but 
SeekToFirst() is rather slow.

Original comment by wuzuy...@gmail.com on 16 Sep 2013 at 9:04

GoogleCodeExporter commented 9 years ago
same question here.
total amount of data is only 512MB. SeekToFrist() blocked about 1 seconds 
everytime i call it.I used a custom comparator which parse the key to uint64. 
Did that causes the delay in SeekToFirst() ? 

Original comment by ufo2...@gmail.com on 4 Nov 2013 at 3:24