Hi,

I am currently testing to check database corrupted / malformed.
Database size :1G
table num : 1
index num : 1

The database can be malformed or normal.

When I executing quick_check against a normal database, it takes about
3 minutes from the time of the first execution since opening.
If database is malformed, it will be checked faster than 3 minutes
based on what part of the file is malformed.

On the other hands, when i execute the "select max (rowid) from
table_name" command on the database when it is malformed or normal,
get results according to the situation and get results within about 1
second.

================== TEST CASE ================
* malformed DB checking by select statement *
sqlite> select max(rowid) from test_t;
Run Time: real 0.003 user 0.000000 sys 0.000000
Error: database disk image is malformed

* normal DB checking by select statement *
sqlite> select max(rowid) from test_t;
4644298
Run Time: real 0.074 user 0.000000 sys 0.000000

* malformed DB checking by "quick_check" *
sqlite> pragma quick_check;
Run Time: real 0.000 user 0.000000 sys 0.000000
Error: database disk image is malformed

* normal DB checking by "quick_check" *
sqlite> pragma quick_check;
ok
Run Time: real 201.368 user 1.350000 sys 1.570000
===============================================

The main point of the question is that if the "quick_check" is slow
according to the size of the database,
in order to confirm the checking of malformed of the DB I would like
to ask if I can replace it with the above select statement instead of
"integrity_check" or "quick_check".

Thank you very much.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to