First of all: What do you call a Big Database?
https://www.sqlite.org/limits.htmlIn my experience poor database performance results have 3 main reasons
- bad database design
- bad index structure (if an index is used whose data is not organised in small chunks but rather in large blocks (i.e. the same data is often found in the data field) then the database optimiser can also decide to perform a full table scan instead of using the index.
- bad SELECT statements.
A query in an SQL database has several steps. Roughly and not completely:
- Receive statement
- Parse statement
- Decide on access path
- Search for data
- Provide data
- Transfer result data.
And one of the longest steps in terms of time is often transferring the data. This is why the type of programming is crucial for performance.
"SELECT *" is therefore an absolute no-go; you only retrieve the absolute minimum of data that is actually needed. Concerning rows AND columns.
Another way to speed up the process is to use views, as these do not have to be parsed and analysed every time, which saves time.