Re: [sqlite] [EXTERNAL] Comparison of incompatible types

2019-09-16 Thread sky5walk
Good catch! I will check if I have similar errors, but printf() returns TEXT, round() returns FLOAT. So, do your numerical comparisons BEFORE formatting statements. On Mon, Sep 16, 2019 at 2:45 AM Hick Gunter wrote: > This is well documented in https://sqlite.org/datatypes.html and >

Re: [sqlite] Fastest way to SELECT on a set of keys?

2019-09-16 Thread Jens Alfke
> On Sep 13, 2019, at 1:30 PM, Keith Medcalf wrote: > > The only thing that is clear is that where the overhead of executing each > select is significant it is clearly better to execute fewer of them. Thanks for the research, Keith! In my case the per-query overhead is lower since I'm

Re: [sqlite] [EXTERNAL] Fastest way to SELECT on a set of keys?

2019-09-16 Thread Simon Slavin
On 16 Sep 2019, at 5:58pm, Jens Alfke wrote: > Experimentally, the optimizer seems to choose an index search even with the > simpler query. I ran this on a test database with about 30k rows. In case you forgot I'm just reminding you to run ANALYZE after putting your data and indexes in.

Re: [sqlite] [EXTERNAL] Fastest way to SELECT on a set of keys?

2019-09-16 Thread Jens Alfke
> On Sep 13, 2019, at 10:57 AM, Hick Gunter wrote: > > This is faster if the number of keys in the list is small relative to the > number of records in the table. > If the number of keys is similar to the number of records in the table, then > a simple full table scan may be faster.

Re: [sqlite] [EXTERNAL] Fastest way to SELECT on a set of keys?

2019-09-16 Thread Keith Medcalf
It will, but that depends how many rows there are. That is, the statement: SELECT * FROM t1 WHERE id IN (1,2,3,4,5,6) Is equivalent to CREATE TEMPORARY TABLE keyset (key PRIMARY KEY); INSERT OR IGNORE INTO keyset VALUES (1), (2), (3), (4), (5), (6); SELECT * FROM t1 WHERE id IN keyset; DROP

Re: [sqlite] [EXTERNAL] Fastest way to SELECT on a set of keys?

2019-09-16 Thread E.Pasma
Stop stop stop > create table x > ( >id integer primay key, >datablob > ); I did not see this until searching for the word PRIMARY and not finding it. Thus id is not a primary key at all. Probably it is a good habit to always add WITHOUT ROWID when there is an explicit primary

[sqlite] How to install REGEXP support?

2019-09-16 Thread Peng Yu
Hi, I'd like to have regexp support in sqlite3. https://www.sqlite.org/lang_expr.html#regexp But it is not clear how to install it for sqlite3 installed by homebrew. Does anybody how to install it? Thanks. https://stackoverflow.com/questions/5071601/how-do-i-use-regex-in-a-sqlite-query --

Re: [sqlite] [EXTERNAL] Fastest way to SELECT on a set of keys?

2019-09-16 Thread Jose Isaias Cabrera
Keith Medcalf, on Monday, September 16, 2019 01:33 PM, wrote... > > It will, but that depends how many rows there are. > > That is, the statement: SELECT * FROM t1 WHERE id IN (1,2,3,4,5,6) > > Is equivalent to > > CREATE TEMPORARY TABLE keyset (key PRIMARY KEY); > INSERT OR IGNORE INTO keyset

Re: [sqlite] How to install REGEXP support?

2019-09-16 Thread Peng Yu
Do you know what the commands are to just compile for the regex support? > SQLite doesn't come with a regexp implementation; it has to be added by an > extension. > I searched the website; there's a simple implementation here: > >

Re: [sqlite] [EXTERNAL] Fastest way to SELECT on a set of keys?

2019-09-16 Thread Keith Medcalf
On Monday, 16 September, 2019 14:22, E.Pasma wrote: >Stop stop stop >> create table x >> ( >>id integer primay key, >>datablob >> ); >I did not see this until searching for the word PRIMARY and not finding >it. Thus id is not a primary key at all. Probably it is a good habit

Re: [sqlite] How to install REGEXP support?

2019-09-16 Thread Warren Young
On Sep 16, 2019, at 6:24 PM, Peng Yu wrote: > > Do you know what the commands are to just compile for the regex support? https://www.sqlite.org/loadext.html ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] How to install REGEXP support?

2019-09-16 Thread Jens Alfke
> On Sep 16, 2019, at 1:44 PM, Peng Yu wrote: > > But it is not clear how to install it for sqlite3 installed by > homebrew. Does anybody how to install it? Thanks. SQLite doesn't come with a regexp implementation; it has to be added by an extension. I searched the website; there's a simple

Re: [sqlite] [EXTERNAL] Comparison of incompatible types

2019-09-16 Thread Hick Gunter
This is well documented in https://sqlite.org/datatypes.html and https://sqlite.org/datatype3.html -Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von kapil Gesendet: Samstag, 14. September 2019 11:15 An: