• Welcome to SQLitening Support Forum.
 

News:

Welcome to the SQLitening support forums!

Main Menu

Timing problem

Started by Fim, May 18, 2023, 10:10:00 AM

Previous topic - Next topic

Fim

In a program to find words from a database of 4 million words, I have a timing problem.
If I execute a select statement, for example
SELECT * FROM WORDLIST WHERE LENGTH = 10
and then downloads all the selected data, it takes 6 seconds on a completely just started PC. The second time when I execute another select statement, SELECT * FROM WORDLIST WHERE LANGD = 12, and then retrieve all the selected data, it takes 0.6 seconds. If I exit the program without restarting the PC, restart the program, all the select statements take less than a second.
I've come so far in my research that it's not the Select statement itself that takes time, it's the subsequent fetching of data that takes time.
Anyone have a good explanation?
Fim W

Fim

Now it wasn't the select statements that were the problem, they work as they should. The problem is that the first select statement takes 6 seconds but the next select statement only takes 0.6 seconds.
Fim W

cj

#2
SELECT * FROM WORDLIST WHERE LENGTH = 10  'missing column name

https://sqlite.org/forum/forumpost/fc1209eb59bcdbc0ec81e193561063707bcd36953d78a7c295521cd20277d674

QuoteThis is usually due to the operating system keeping recently used disk blocks in memory and/or SQLite doing the same with recently used pages from the database file.