c# - Improve an SQLite query that returns many records -
i have query gets executed on sqlite database table wpf application; query can return large amount of records (from 80000 1 million) down-sample before displaying it. takes 10 seconds return 700000 records, can optimized in way?
the clause filters records date time column:
(where collectedon > @starttime , collectedon < @endtime)
and i'm selecting of 18 columns of table. number of columns influence executing time of query?
thanks comments. should point out few more things:
the data collect needs displayed in chart; since want display 600 points algorithm picks 1 point every 600 700000 records. can achieved in single query?
these of things consider:
- further narrowing down number of returned records (you said down-sample before displaying... can down-sample within database or clause)?
- do need records @ once? maybe paging (see limit , offset)
- you try use index speed query. use explain find out query exactly... afterwards can optimize joins , selections (also use indices joins).
narrowing down attributes thing (instead of returning columns), @ least simple queries (no subselects), have less influence selecting right rows using clause. search "selection" , "projection" issue.
Comments
Post a Comment