[sqlite] IS a SQLite db of small size as good as reliable cache?

2016-01-30 Thread Jean-Christophe Deschamps
At 22:57 30/01/2016, you wrote: >2 further if such a db is part of windows service / application running >continuously then may be pages will remain in the memory under normal >conditions. > >Q1) Operating System like Windows would cache the series of pages, is this >behavior not almost same as

[sqlite] Find out how many times does SQLite hit the disk?

2016-01-30 Thread Simon Slavin
On 30 Jan 2016, at 9:31pm, dpb wrote: > On windows, is there a way to find out how many times does my SQLite DB hit > the disk? > > This will help me in deciding if moving to In-memory SQLite will improve my > application performance. You will find that tools which examine process statistics

[sqlite] Wish List for 2016: High Level API for Object Oriented Interactive Languages

2016-01-30 Thread Simon Slavin
On 30 Jan 2016, at 8:13pm, Yannick Duch?ne wrote: > In my opinion (which some others share), OO is a bag of miscellaneous things > which are better tools and better understood when accosted individually. Just > trying to define what OO is, shows it: is this about late binding? (if it is, >

[sqlite] IS a SQLite db of small size as good as reliable cache?

2016-01-30 Thread Howard Chu
dpb wrote: > Dear Community, > > Assuming that SQLite would arrange the database table contents on page > boundary and > > 1) if db is small let us say maximum 5MB, > > 2 further if such a db is part of windows service / application running > continuously then may be pages will remain in the

[sqlite] JSON aggregate function producing invalid JSON?

2016-01-30 Thread Marien Zwart
Either I am misusing the JSON functions in a way I do not understand, or this is a bug: SQLite version 3.10.2 2016-01-20 15:27:19 ... sqlite> CREATE TABLE t (n INTEGER PRIMARY KEY, s1 TEXT); sqlite> INSERT INTO t (n, s1) VALUES (0, NULL), (1, 'foo'); sqlite> SELECT n, json_group_array(s1),

[sqlite] Wish List for 2016: High Level API for Object Oriented Interactive Languages

2016-01-30 Thread Yannick Duchêne
On Sat, 30 Jan 2016 14:56:15 -0500 "James K. Lowden" wrote: > On Thu, 28 Jan 2016 16:47:40 -0500 > Jim Callahan wrote: > > > I am hopeful this new JDBC based interface will provide as > > satisfactory high level channel between SQLite3 and Python. > > As someone who's written a couple of OO

[sqlite] Wish List for 2016: High Level API for Object Oriented Interactive Languages

2016-01-30 Thread Jim Callahan
I am not interested in a complete ORM; what I am interested is when the object-oriented language supports a SQL-R-like object. In R, the object is called a data.frame and the package "Pandas" supplies a similar data frame object to Python. https://pypi.python.org/pypi/pandas/0.10.0/ R as I have

[sqlite] `explain query plan`: does it have any side effects?

2016-01-30 Thread Yannick Duchêne
On Sat, 30 Jan 2016 19:07:21 + Simon Slavin wrote: > > On 30 Jan 2016, at 6:56pm, Yannick Duch?ne > wrote: > > > > That's strange, or may be it's SQLiteBrowser specific (I'm using it to test > > queries and get timings). > > Oh, you're not using your own code. > > Download the SQLite

[sqlite] Find out how many times does SQLite hit the disk?

2016-01-30 Thread J Decker
On Sat, Jan 30, 2016 at 8:09 PM, J Decker wrote: > could use a tool like ProcMon and filter to disk activity on a > specified file to see... > https://technet.microsoft.com/en-us/sysinternals/processmonitor.aspx?f=255=-2147217396 Might not actually be useful though; if the file is memory mapped

[sqlite] Find out how many times does SQLite hit the disk?

2016-01-30 Thread J Decker
could use a tool like ProcMon and filter to disk activity on a specified file to see... https://technet.microsoft.com/en-us/sysinternals/processmonitor.aspx?f=255=-2147217396 On Sat, Jan 30, 2016 at 3:21 PM, Simon Slavin wrote: > > On 30 Jan 2016, at 9:31pm, dpb wrote: > >> On windows, is there

[sqlite] Bug: Successfully committed transaction rolled back after power failure

2016-01-30 Thread Simon Slavin
On 30 Jan 2016, at 7:56pm, James K. Lowden wrote: > Given that the fsync has returned successfully, I don't know of any > hardware that then will take 1000 ms to complete the write. That's the > basis for my "subsecond interval" assumption. Writing to a RAID which has other write commands

[sqlite] `explain query plan`: does it have any side effects?

2016-01-30 Thread Yannick Duchêne
On Sat, 30 Jan 2016 19:03:12 +0100 Yannick Duch?ne wrote: > > On 30 Jan 2016, at 4:55pm, Yannick Duch?ne > > wrote: > > > > > Tweaking a query, I notice a query executed after I did an `explain query > > > plan `, executes faster than before it occured. > > > > Computer reads data from disk

[sqlite] `explain query plan`: does it have any side effects?

2016-01-30 Thread Simon Slavin
On 30 Jan 2016, at 6:56pm, Yannick Duch?ne wrote: > > That's strange, or may be it's SQLiteBrowser specific (I'm using it to test > queries and get timings). Oh, you're not using your own code. Download the SQLite command line tool and try the same queries. The shell tool does no caching

[sqlite] `explain query plan`: does it have any side effects?

2016-01-30 Thread Yannick Duchêne
On Sat, 30 Jan 2016 17:41:49 + Simon Slavin wrote: > > On 30 Jan 2016, at 4:55pm, Yannick Duch?ne > wrote: > > > Tweaking a query, I notice a query executed after I did an `explain query > > plan `, executes faster than before it occured. > > Computer reads data from disk when you do

[sqlite] Best way to store only date

2016-01-30 Thread Yannick Duchêne
On Sat, 30 Jan 2016 14:22:06 +0100 "E.Pasma" wrote: > With respect to Igor's suggestion, mmdd (as integer), why not leave out > the century? I prefer the oldfashoned yymmdd. And what about a planned Y3K bug? -:D (teasing) > The diagram got broken in my email and here is another try: > >

[sqlite] `explain query plan`: does it have any side effects?

2016-01-30 Thread Yannick Duchêne
Funny real thing or illusion? Tweaking a query, I notice a query executed after I did an `explain query plan `, executes faster than before it occured. I checked multiple times in case it could be due to something else in the environment or due to since how long the SQLite connexion is opened,

[sqlite] `explain query plan`: does it have any side effects?

2016-01-30 Thread Simon Slavin
On 30 Jan 2016, at 4:55pm, Yannick Duch?ne wrote: > Tweaking a query, I notice a query executed after I did an `explain query > plan `, executes faster than before it occured. Computer reads data from disk when you do the "EXPLAIN QUERY PLAN". Data still in cache when you run the real

[sqlite] Problem with distinct select query

2016-01-30 Thread R Smith
On 2016/01/29 4:51 PM, Gary Baranzini wrote: > Hi, > > I have a query where I select 20 random distinct rows. > > SELECT DISTINCT formulas.pinyin, formulas.majorcategory, > majorfcategory.item_name > FROM formulas > JOIN majorfcategory ON majorfcategory.id=formulas.majorcategory > ORDER BY

[sqlite] Best way to store only date

2016-01-30 Thread R Smith
On 2016/01/30 3:22 PM, E.Pasma wrote: > The diagram got broken in my email and here is another try: > > Needs to be light | Needs to be| Needs to do | > (small footprint) | Human-Readable | calculations | > - | ---| | > YES |

[sqlite] Best way to store only date

2016-01-30 Thread E.Pasma
30-01-2016 14:59, R Smith: > > > On 2016/01/30 3:22 PM, E.Pasma wrote: >> The diagram got broken in my email and here is another try: >> >> Needs to be light | Needs to be| Needs to do | >> (small footprint) | Human-Readable | calculations | >> - | ---|

[sqlite] Best way to store only date

2016-01-30 Thread Igor Tandetnik
On 1/30/2016 12:22 PM, Yannick Duch?ne wrote: > Why ?NO? for ?Needs to do calculations? with Igor's suggestion? Well, depends > on what is doing the calculation, may be. Things like "number of days elapsed between these two dates" is trivial with Julian day or similar, but MMDD

[sqlite] Wish List for 2016: High Level API for Object Oriented Interactive Languages

2016-01-30 Thread James K. Lowden
On Thu, 28 Jan 2016 16:47:40 -0500 Jim Callahan wrote: > I am hopeful this new JDBC based interface will provide as > satisfactory high level channel between SQLite3 and Python. As someone who's written a couple of OO DBMS libraries and uses the Python SQLIte module, I wonder what you're hoping

[sqlite] Bug: Successfully committed transaction rolled back after power failure

2016-01-30 Thread James K. Lowden
On Thu, 28 Jan 2016 08:00:08 + Meinlschmidt Stefan wrote: > > But I ask you, what action could the application possibly take, in > > that subsecond interval, that it matters? > > Under the QNX OS using a QNX6 filesystem with default configuration, > that ?subsecond interval? is actually up

[sqlite] Best way to store only date

2016-01-30 Thread E.Pasma
The diagram got broken in my email and here is another try: Needs to be light | Needs to be| Needs to do | (small footprint) | Human-Readable | calculations | - | ---| | YES | YES| NO | Integer as

[sqlite] Best way to store only date

2016-01-30 Thread Simon Slavin
On 30 Jan 2016, at 1:22pm, E.Pasma wrote: > With respect to Igor's suggestion, mmdd (as integer), why not leave out > the century? I prefer the oldfashoned yymmdd. While writing this program you develop a library for handling dates. Then another program comes along for which some dates

[sqlite] ​ Use Bash to Store Disc Info in SQLite

2016-01-30 Thread Cecil Westerhof
2016-01-30 3:40 GMT+01:00 Stephen Chrzanowski : > On Fri, Jan 29, 2016 at 8:59 PM, Cecil Westerhof > wrote: > > > > > > However, I've run into a few problems, so I'm offering my findings and > > > fixes. > > > > > > The first, line 3, you've got a reference to a script that doesn't > exist > > >

[sqlite] Bug: Successfully committed transaction rolled back after power failure

2016-01-30 Thread Keith Medcalf
That varies with your definition of RAID. With a decent hardware RAID controller that works properly, the RAID controller can have megabytes or gigabytes of data which has not been written to the physical spinning disk when power is abruptly turned off. And none of it will be lost. Then you

[sqlite] Best way to store only date

2016-01-30 Thread Gabor Grothendieck
I frequently have to deal with dates coming from R's "Date" class which stores dates as the number of days since the UNIX epoch. So if x is the number of days since 1970-01-01 then this gives the -mm-dd representation of the date date(x + 2440588) and (annoyingly owing to the need for

[sqlite] JSON aggregate function producing invalid JSON?

2016-01-30 Thread Richard Hipp
On 1/30/16, Marien Zwart wrote: > Either I am misusing the JSON functions in a way I do not understand, > or this is a bug: It is a bug (https://www.sqlite.org/src/info/f45ac567eaa9f93) which is now fixed on trunk. Thank you for the bug report and for the succinct test case. -- D. Richard

[sqlite] Best way to store only date

2016-01-30 Thread Jim Callahan
> the century? I prefer the oldfashoned yymmdd. > The advantage of the four-digit year is that it can be used for sorting > over a wide range. Let's not create a Y2100 problem; right after fixing Y2K! ;)

[sqlite] Best way to store only date

2016-01-30 Thread Igor Tandetnik
On 1/30/2016 8:22 AM, E.Pasma wrote: > With respect to Igor's suggestion, mmdd (as integer), why not leave out > the century? I prefer the oldfashoned yymmdd. I too like to live dangerously. -- Igor Tandetnik

[sqlite] Best way to store only date

2016-01-30 Thread Gerry Snyder
On Jan 30, 2016 6:18 AM, "E.Pasma" wrote: > > The diagram got broken in my email and here is another try: > > Needs to be light | Needs to be| Needs to do | > (small footprint) | Human-Readable | calculations | > - | ---| | > YES |

[sqlite] ​ Use Bash to Store Disc Info in SQLite

2016-01-30 Thread Cecil Westerhof
Just a short reply, because I should be sleeping now. ;-) 2016-01-30 1:14 GMT+01:00 Stephen Chrzanowski : > This is going to be useful for me for a couple of reasons. First, I've got > a machine at work that mysteriously fills up, and more importantly, I can > monitor my Minecraft server at

[sqlite] Best way to store only date

2016-01-30 Thread R Smith
On 2016/01/29 5:23 PM, Igor Tandetnik wrote: > > Personally, I prefer cast(strftime('%Y%m%d', 'now') as int) - in other > words, storing calendar dates as integers like 20160129. The main advantage of this format is that it is of course human-readable, even as an integer. The important

[sqlite] ​ Use Bash to Store Disc Info in SQLite

2016-01-30 Thread Simon Slavin
On 30 Jan 2016, at 12:14am, Stephen Chrzanowski wrote: > And finally, maybe not the scripts fault, but there was an oddball > directory made by one of the Minecraft mods that pooched the script. > Literally, the directory was >