Re: [sqlite] Weird query plan when sorting by a joined column

2018-05-23 Thread Torsten Landschoff
y to fix this, I am just curious about what might cause it. Greetings, Torsten -- $---+1+2+3+4+5+----6+ SCALE GmbH Niederlassung Dresden Torsten Landschoff Pohlandstraße 19 01309 Dresden Tel: +49-351-312002-10 Fax: +49-351-312002-29 SCALE GmbH Reg

Re: [sqlite] Weird query plan when sorting by a joined column

2018-05-16 Thread Torsten Landschoff
On 16.05.2018 12:32, Richard Hipp wrote: > On 5/16/18, Torsten Landschoff <torsten.landsch...@scale.eu> wrote: >> >> Actually it is: SQLite will generate the same query plan for both >> queries as long as no statistics data is available. Adding the >> statistics

Re: [sqlite] Weird query plan when sorting by a joined column

2018-05-16 Thread Torsten Landschoff
caught off guard when confronted with less than optimal SQL. Greetings, Torsten -- $---+1+2+3+4+5----+6----+ SCALE GmbH Niederlassung Dresden Torsten Landschoff Pohlandstraße 19 01309 Dresden Tel: +49-351-312002-10 Fax: +49-351-312002-29 S

Re: [sqlite] Weird query plan when sorting by a joined column

2018-05-16 Thread Torsten Landschoff
original query. I should have made that more explicit in my original mail but it was late and I spent the 2 hours before with stripping down our schema and database to the small reproducing example. Greetings, Torsten -- $---+1+2+3+4+5+6----+ SCALE

Re: [sqlite] Weird query plan when sorting by a joined column

2018-05-15 Thread Torsten Landschoff
On 16.05.2018 00:12, Torsten Landschoff wrote: > In case anybody would be so kind and take a look at this I included a > small SQL Script to reproduce. Results here are: > > -- >> $ /opt/sqlite3/bin/sqlite3 -version >> 3.

[sqlite] Weird query plan when sorting by a joined column

2018-05-15 Thread Torsten Landschoff
.11] > 28Next 2 24000 > 29Halt 0 0 000 > 30Transaction0 0 4 0 01 usesStmtJournal=0 > 31Integer 5463052 7 0

[sqlite] SQLite behaviour when modifying sqlite_master (was: Re: pragma integrity_check doesn't check constraints without indices)

2016-10-17 Thread Torsten Landschoff
ings, Torsten -- $---+1+2+3+4+5+6----+ SCALE GmbH Niederlassung Dresden Torsten Landschoff Pohlandstraße 19 01309 Dresden Tel: +49-351-312002-10 Fax: +49-351-312002-29 SCALE GmbH Registergericht und Sitz: Ingolstadt, HRB 6384 Geschäftsführer: Dr.-Ing.

[sqlite] pragma integrity_check doesn't check constraints without indices

2016-10-17 Thread Torsten Landschoff
l NOT NULL columns really are NOT NULL */ for(j=0; jnCol; j++){ // ... It appears to me that the row based primary key index is not counted as an index by pTab->pIndex so the NOT NULL checks are skipped without index. Greetings, Torsten -- $---+1+2+3+

[sqlite] pragma integrity_check doesn't check constraints without indices

2016-10-14 Thread Torsten Landschoff
3 32000 if r[3]!=NULL > goto 32 > 28 String80 3 0 NULL value in example.address 00 > r[3]='NULL value in example.address' > 59IsNull 2 640 00 if r[2]==NULL goto > 64 Greetings, To