Re: [sqlite] Why sqlite3 running at different time can have very different speed?

2019-10-19 Thread Simon Slavin
On 20 Oct 2019, at 1:54am, Peng Yu wrote: > How to prove the large time difference of sqlite3 is indeed due to > cache and where is the cache? Keep the database on an external drive (e.g. USB Flash drive). Unmount the drive to be sure that the cache has been cleared. > Why the caching used by

Re: [sqlite] Why sqlite3 running at different time can have very different speed?

2019-10-19 Thread Dominique Pellé
Peng Yu wrote: I have never seen such a dramatic difference in non-sqlite3 > operations. For example, cat has some difference but is ~13%. > > $ time cat file.sqa > /dev/null > > real0m7.282s > user0m0.067s > sys0m2.371s > $ time cat file.sqa > /dev/null > > real0m6.316s > user

Re: [sqlite] Why sqlite3 running at different time can have very different speed?

2019-10-19 Thread Keith Medcalf
On Saturday, 19 October, 2019 18:55, Peng Yu wrote: >I have never seen such a dramatic difference in non-sqlite3 >operations. For example, cat has some difference but is ~13%. Have you been looking? >$ time cat file.sqa > /dev/null > >real0m7.282s >user0m0.067s >sys0m2.371s >$ tim

Re: [sqlite] Standard deviation last x entries

2019-10-19 Thread Keith Medcalf
Here is a recursive CTE that will calculate the square root to the best precision your processor math implementation is capable of. It limits the recursion by prohibiting the insertion of duplicate guesses by using UNION rather than UNION ALL, which will cause pathological cases that oscillate

Re: [sqlite] Why sqlite3 running at different time can have very different speed?

2019-10-19 Thread Peng Yu
I have never seen such a dramatic difference in non-sqlite3 operations. For example, cat has some difference but is ~13%. $ time cat file.sqa > /dev/null real0m7.282s user0m0.067s sys0m2.371s $ time cat file.sqa > /dev/null real0m6.316s user0m0.062s sys0m2.319s How to

Re: [sqlite] select for power-meter accumulated total readings

2019-10-19 Thread Keith Medcalf
On Saturday, 19 October, 2019 18:26, Petr Jakeš wrote: >After long time I have set up development environment properly and I am >able to start to study your queries. >I am lost. I don't either understand the first bunch of subqueries... ( >What is returned in the "ratetoprior"? I have been pull

Re: [sqlite] Why sqlite3 running at different time can have very different speed?

2019-10-19 Thread Keith Medcalf
On Saturday, 19 October, 2019 18:05, Peng Yu wrote: Looks like the difference between reading from disk and reading from cache. >I see that sqlite3 can be very different in terms of run time. >$ time sqlite3 file.sqa -Atv > /dev/null > >real0m3.259s >user0m0.193s >sys0m0.704s >$ t

Re: [sqlite] select for power-meter accumulated total readings

2019-10-19 Thread Petr Jakeš
After long time I have set up development environment properly and I am able to start to study your queries. I am lost. I don't either understand the first bunch of subqueries... ( What is returned in the "ratetoprior"? I have been pulling my hair over 3 hours trying to figure it out ... no clue w

[sqlite] Why sqlite3 running at different time can have very different speed?

2019-10-19 Thread Peng Yu
Hi, I see that sqlite3 can be very different in terms of run time. $ time sqlite3 file.sqa -Atv > /dev/null real0m3.259s user0m0.193s sys0m0.704s $ time sqlite3 file.sqa -Atv > /dev/null real0m0.148s user0m0.086s sys0m0.057s # Then do some else briefly $ time sqlite3

[sqlite] Katai based SQLite file format readers

2019-10-19 Thread Alek Paunov
SQLite file format [1] as executable description in Katai Struct YAML [2] (contribution of Mr. Mikhail Yakshin [3]). Katai seems as a very good library in the hot field of the declarative binary formats manipulation. King Regards, Alek [1] https://sqlite.org/fileformat.html https://sqlite.o