[sqlite] Tutorial on SQLite Internals - 2019-11-05 in Houston, TX

2019-09-02 Thread Richard Hipp
There will be a full-day tutorial on SQLite Internals on Tuesday 2019-11-05 in Houston TX. See details at: https://www.tcl.tk/community/tcl2019/tutorials.html#drh:sqlite-tour1 This will be an intensive tutorial. Bring your laptop, with a C-compiler already installed, and also with TCL

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

2019-09-02 Thread Keith Medcalf
On Monday, 2 September, 2019 12:26, Petr Jakeš wrote: >Yes, you are right. The error is connected with the version of >SQLite. Now I am trying to build DB Browser using SQLite version 3.29.0. >Than I have to study your code. Your knowledge and SQL Windows >functions are over my scope. Thank

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

2019-09-02 Thread Petr Jakeš
Yes, you are right. The error is connected with the version of SQLite. Now I am trying to build DB Browser using SQLite version 3.29.0. Than I have to study your code. Your knowledge and SQL Windows functions are over my scope. Thank for the study material for next weekend :D On Mon, Sep 2, 2019

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

2019-09-02 Thread Keith Medcalf
On Monday, 2 September, 2019 10:34, Petr Jakeš wrote: >Wow, this is HUUUDGE !!! >Thanks! >What editor are you using, btw? Typically this is on Windows 10 (for Workstations) and the editor I use is TSE (The Semware Editor). Started using TSE under OS/2 way back and I like it a lot and have

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

2019-09-02 Thread Petr Jakeš
Wow, this is HUUUDGE !!! Thanks! What editor are you using, btw? I am on Linux Mint and trying your queries with "SQLite Studio" and "DB Browser for SQLite" is throwing syntax error (I think because of the rows "lead(timestamp) over (order by timestamp) as next_timestamp," From the sqlite3

Re: [sqlite] [EXTERNAL] Non-keyword quoted identifiers parsed as string literals

2019-09-02 Thread William Chargin
> This is documented behaviour. Use single quotes for literal strings. > SQLite will assume you meant 'literlal' if your write "literal" and > there is no column of that name. There is no need to quote names in > SQLite unless the name contains non-alpha characters. Thanks, yes. I was quoting the

Re: [sqlite] http://roaringbitmap.org/

2019-09-02 Thread Robert M. Münch
On 2 Sep 2019, at 10:59, Dominique Devienne wrote: > On Mon, Sep 2, 2019 at 8:06 AM Robert M. Münch > wrote: > >> Hi, I think that SQLite use some bitmap indexes > > > Not that I know of, but I don't know the full source code. Maybe FTS[345] > do/es, but SQLite itself only uses BTree-indexes

Re: [sqlite] [EXTERNAL] Re: http://roaringbitmap.org/

2019-09-02 Thread Hick Gunter
The base table is also a virtual table (we have nearly no native SQLite tables) that stores variable length, variable content logfiles and supports access via record offset, serial number and stored datetime. The effort of decoding specific attributes is significant (sequential read and decode

Re: [sqlite] INSERT vs BEGIN

2019-09-02 Thread Dominique Devienne
On Mon, Sep 2, 2019 at 12:52 PM Simon Slavin wrote: > > One must know that I am obliged to use "BEGIN DEFERRED TRANSACTION" > because others threads needs to access to tables. > SQLite copes very well when you have one connection writing to the > database and other connections reading. The

Re: [sqlite] INSERT vs BEGIN

2019-09-02 Thread Dominique Devienne
On Mon, Sep 2, 2019 at 12:04 PM Grincheux <51...@protonmail.ch> wrote: > What is the best ? > > INSERT INTO artists (name) VALUES > ("Gene Vincent") ... > ("Moi _ Me"); > You're missing commas. And you should not use double-quotes but single-quotes for string-literals. > I want to insert 1 000

Re: [sqlite] [EXTERNAL] char(0) with SQLite

2019-09-02 Thread Dominique Devienne
On Mon, Sep 2, 2019 at 12:12 PM Hick Gunter wrote: > Dimensions are ignored by SQLite. A field defined CHAR(0) can hold any > length (up to the internal limit) of string. SQlite will only store the > actual length of the string plus its contents, no space is wasted. And Gunter wrote "string"

Re: [sqlite] [EXTERNAL] Re: http://roaringbitmap.org/

2019-09-02 Thread Dominique Devienne
On Mon, Sep 2, 2019 at 12:08 PM Hick Gunter wrote: > Back in 2011 I implemented a virtual table using the "fastbit" library by > John Wu of the Lawrence Berekely National Laboratory. This allowed selects > of the form > > SELECT ... FROM WHERE rowid IN (SELECT rowid FROM > WHERE ); > Did it

Re: [sqlite] INSERT vs BEGIN

2019-09-02 Thread Simon Slavin
On 1 Sep 2019, at 7:27am, Grincheux <51...@protonmail.ch> wrote: > INSERT INTO artists (name) VALUES > ("Gene Vincent") > ("John Lennon") > ("Ringo Starr") > ("Paul McCartney") > . > . > . > ("Moi _ Me"); > > I want to insert 1 000 000 records. SQLite has to parse the entire command line before

Re: [sqlite] [EXTERNAL] char(0) with SQLite

2019-09-02 Thread Olivier Mascia
> Le 2 sept. 2019 à 12:12, Hick Gunter a écrit : > >> Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im >> Auftrag von Grincheux >> Into my db I store passwords having differents lengths (from 1 to 50). >> I don't want to give the max size that woud be using space I

Re: [sqlite] [EXTERNAL] INSERT vs BEGIN

2019-09-02 Thread Hick Gunter
For batch loading via script, you should limit the number of values per statement (SQLite compiles each statement into memory) and per transaction (SQLite needs to write to disk after a certain number of pages are modified). For batch loading via program, you can prepare the insert statement

Re: [sqlite] Tracking item history using SQLite

2019-09-02 Thread Rob Willett
Hi, We aren't storing first_seen in every row. Each incident is something like Date_Time_of_update_in_epoch_secs1 unique_incident_number information about the incident> Date_Time_of_update_in_epoch_secs2 unique_incident_number information about the incident> Date_Time_of_update_in_epoch_secs3

Re: [sqlite] [EXTERNAL] char(0) with SQLite

2019-09-02 Thread Hick Gunter
Dimensions are ignored by SQLite. A field defined CHAR(0) can hold any length (up to the internal limit) of string. SQlite will only store the actual length of the string plus its contents, no space is wasted. -Ursprüngliche Nachricht- Von: sqlite-users

Re: [sqlite] [EXTERNAL] Re: http://roaringbitmap.org/

2019-09-02 Thread Hick Gunter
Back in 2011 I implemented a virtual table using the "fastbit" library by John Wu of the Lawrence Berekely National Laboratory. This allowed selects of the form SELECT ... FROM WHERE rowid IN (SELECT rowid FROM WHERE ); provided that the data had been inserted before by running INSERT INTO

[sqlite] INSERT vs BEGIN

2019-09-02 Thread Grincheux
What is the best ? INSERT INTO artists (name) VALUES ("Gene Vincent") ("John Lennon") ("Ringo Starr") ("Paul McCartney") . . . ("Moi _ Me"); I want to insert 1 000 000 records. The other manner tot do is creating a transaction with one insert command by line. My question is what is the best

[sqlite] char(0) with SQLite

2019-09-02 Thread Grincheux
Into my db I store passwords having differents lengths (from 1 to 50). I don't want to give the max size that woud be using space I don't need. I found that sqlite permits char(0) but what is the incidence for my db. -- Sent from: http://sqlite.1065341.n5.nabble.com/

Re: [sqlite] Tracking item history using SQLite

2019-09-02 Thread Rob Richardson
Why are you storing first_seen in every record? To avoid searching for it when reports are generated? On Sat, Aug 31, 2019 at 6:24 AM Rob Willett wrote: > Hi, > > We have a very similar system that captures traffic incident information > such as accidents, roadworks, traffic jams and sends

Re: [sqlite] Query planner regression with FTS4: slower path is chosen

2019-09-02 Thread Paul
I has been a while without response, so I just bumping this message. 19 July 2019, 14:21:27, by "Paul" : > I have a test case when the regression can be observed in queries that > use JOINs with FTS4 tables, somewhere in between 3.22.0 and 3.23.0. > For some reason the planner decides to

Re: [sqlite] http://roaringbitmap.org/

2019-09-02 Thread Dominique Devienne
On Mon, Sep 2, 2019 at 8:06 AM Robert M. Münch wrote: > Hi, I think that SQLite use some bitmap indexes Not that I know of, but I don't know the full source code. Maybe FTS[345] do/es, but SQLite itself only uses BTree-indexes AFAIK. > and this here might be of interest if not already

Re: [sqlite] Tracking item history using SQLite

2019-09-02 Thread Dominique Devienne
On Sat, Aug 31, 2019 at 12:24 PM Rob Willett wrote: > 5. SQLite seems to be able to do anything we want it to. [...] > Other people seem worried about the 'lack' of some datatypes, we do > masses of data and date conversations as needed and it's never been a > speed issue or any issue. (since

Re: [sqlite] [EXTERNAL] Non-keyword quoted identifiers parsed as string literals

2019-09-02 Thread Hick Gunter
This is documented behaviour. Use single quotes for literal strings. SQLite will assume you meant 'literlal' if your write "literal" and there is no column of that name. There is no need to quote names in SQLite unless the name contains non-alpha characters. -Ursprüngliche Nachricht-

[sqlite] http://roaringbitmap.org/

2019-09-02 Thread Robert M. Münch
Hi, I think that SQLite use some bitmap indexes and this here might be of interest if not already used/known: http://roaringbitmap.org/ I think it’s from the same guy how did SIMDJSON. Viele Grüsse. -- Robert M. Münch, CEO Saphirion AG smarter | better | faster http://www.saphirion.com