Re: [sqlite] [EXTERNAL] Re: Remove row to insert new one on a full database

2019-04-07 Thread Hick Gunter
First, your rows are NOT "all the same size". SQLite uses a compressed format to store values that, among other things, uses less space for smaller integers. IIRC your records will be (values before colon are the "manifest", values after the colon are the "payload" of a record): (value is 0) (va

Re: [sqlite] [EXTERNAL] Prepared Statement Without a Database Instance

2019-04-07 Thread Hick Gunter
No. The schema is required to correctly compile the statement, and if the schema changes, then the statement needs to be recompiled. IOW: The schema, in the version as it existed at prepare time, is an integral part of the prepared statement. -Ursprüngliche Nachricht- Von: sqlite-users

[sqlite] Optimization corner case with IS?

2019-04-07 Thread Wout Mertens
I noticed this, IS is not treated like = for optimization: SQLITE> CREATE TABLE t(f INTEGER); SQLITE> CREATE INDEX t_f ON t(f) WHERE f IS NOT NULL; SQLITE> EXPLAIN QUERY PLAN SELECT * FROM t WHERE f = 1; QUERY PLAN `--SEARCH TABLE t USING COVERING INDEX t_f (f=?) SQLITE> EXPLAIN QUERY PLAN SELECT

[sqlite] Bug report for rtree.c

2019-04-07 Thread richard parkins
If SQLITE_DEBUG is not defined, rtree.c found at https://www.sqlite.org/src/dir?ci=edb095a9a679c8c7&name=ext/rtree fails to compile. This is because bCorrupt is declared (at line 132) only if SQLITE_DEBUG is defined, but is referenced unconditionally at line 980. Line 980 currently is    assert(

[sqlite] How to use ORDER BY on FTS5 table ?

2019-04-07 Thread Nik Jain
Have a fts5 table with 2 indexed columns. Where the idea is to match by one col and sort using the other one. Something like : "select id from fts where col1 match '50' order by price " This is slow. 0.07 seconds. Removing the order by clause - 0.001 seconds. How do I fix this ? I have a feelin