[sqlite] Optimizer limitation with partial indexes

2020-02-11 Thread Jens Alfke
I'm running into a problem with partial indexes; apparently the query optimizer isn't smart enough. I currently have indexes of the form CREATE INDEX Index1 ON Table (expr1) CREATE INDEX Index2 ON Table (expr2) where expr1 and expr2 are expressions involving table columns. The

Re: [sqlite] Please increase the default for SQLITE_MAX_VARIABLE_NUMBER

2020-02-11 Thread J. King
On February 11, 2020 1:43:30 p.m. EST, Jens Alfke wrote: >I ran into this a few months ago. I ended up just biting the bullet and >constructing a SQL statement by hand, concatenating comma-separated >values inside an "IN (…)" expression. > >Yes, SQL injection is a danger. But if you're being bad

Re: [sqlite] Please increase the default for SQLITE_MAX_VARIABLE_NUMBER

2020-02-11 Thread Richard Hipp
On 2/11/20, J. King wrote: > SQLite also has a 1M byte statement > length limit ... The statement length limit is yet another defense against mischief caused by SQL injections. -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list

Re: [sqlite] Please increase the default for SQLITE_MAX_VARIABLE_NUMBER

2020-02-11 Thread Jens Alfke
> On Feb 11, 2020, at 2:10 AM, Digital Dog wrote: > > Thanks for enlighening again. It was just a thought. It seems it would be a > lot of design and code to maintain the performance while preventing the > original problem from happening. Not worth the trouble. But maybe > increasing the

Re: [sqlite] Make sqlite3 database searchable on Mac OS X

2020-02-11 Thread Jens Alfke
> On Feb 10, 2020, at 8:10 PM, Peng Yu wrote: > > It seems that sqlite3 databases are not searchable by Spotlight on Mac > OS X. Is there a way to make them searchable? Thanks. How would Spotlight know what tables or columns to index? It doesn't understand what database schema mean, and it

Re: [sqlite] How to group this?

2020-02-11 Thread Bart Smissaert
Solved this now, nil to do with SQL, but just running a different search (other value code and then you can ask for a secondary value and no need anymore to find the matching pair). RBS On Mon, Feb 10, 2020 at 8:22 AM Bart Smissaert wrote: > I fully agree with you, but I sofar I have no

Re: [sqlite] "INSERT INTO table AS alias" is invalid inside triggers

2020-02-11 Thread nomad
On Mon Feb 10, 2020 at 01:34:12AM +0100, no...@null.net wrote: > I suspect I have found a parsing error in SQLite 3.30.1. Given the > ... > However if I wrap it inside a trigger: > > CREATE TABLE t2(b INTEGER); > > CREATE TRIGGER t2_ai > AFTER INSERT ON t2 > FOR EACH ROW BEGIN >

Re: [sqlite] Please increase the default for SQLITE_MAX_VARIABLE_NUMBER

2020-02-11 Thread Digital Dog
On Mon, Feb 10, 2020 at 9:03 PM Richard Hipp wrote: > On 2/10/20, Digital Dog wrote: > > Maybe they should be treated as a > > dictionary/hashtable/linked list or similar? > > > > > Parameter look-ups are on the critical path. How much performance are > you willing to give up in order to have

Re: [sqlite] How to group this?

2020-02-11 Thread Jean-Luc Hainaut
On 11/02/2020 01:35, Simon Slavin wrote: I don't think that creating an index on a view actually works, does it? You're right. What was I thinking ? Maybe I've used another implementation of SQL that it does work on. Thanks for picking me up on it. You are right, SQL Server allows you to