Re: [sqlite] Optimization of equality comparison when NULL involved

2007-06-18 Thread Joe Wilson
--- Sean Cunningham <[EMAIL PROTECTED]> wrote: > I have very large datasets and have found that the built in union, > intersect, and except operations do not seem to use indices > (would be happy to be proven wrong here). As such, they > are not very speedy with large large data sets. A

Re: [sqlite] Optimization of equality comparison when NULL involved

2007-06-18 Thread Scott Hess
On 6/18/07, Sean Cunningham <[EMAIL PROTECTED]> wrote: There was talk in the mailing list a while back about creating a new operator that would act as a superset of '==' which would treat NULL==NULL as True. I have seen this in some other database. Anybody know if this is on the roadmap? It

Re: [sqlite] Optimization of equality comparison when NULL involved

2007-06-18 Thread Sean Cunningham
On Jun 15, 2007, at 5:27 PM, Scott Hess wrote: select tableA.path, tableA.value from tableA,tableB where tableA.path=tableB.path and tableA.value=tableB.value union select tableA.path, tableA.value from tableA,tableB where tableA.path=tableB.path and tableA.value IS NULL AND tableB.value IS

Re: [sqlite] Optimization of equality comparison when NULL involved

2007-06-17 Thread Joe Wilson
> select tableA.path, tableA.value from tableA,tableB where > tableA.path=tableB.path and (tableA.value=tableB.value or > (tableA.value IS NULL AND tableB.value IS NULL)); > > It's possible that won't use an index, either, due to the OR, in which > case you could try a union between a select with

Re: [sqlite] Optimization of equality comparison when NULL involved

2007-06-15 Thread Scott Hess
You can use something like: select tableA.path, tableA.value from tableA,tableB where tableA.path=tableB.path and (tableA.value=tableB.value or (tableA.value IS NULL AND tableB.value IS NULL)); It's possible that won't use an index, either, due to the OR, in which case you could try a union

Re: [sqlite] Optimization of equality comparison when NULL involved

2007-06-15 Thread Clark Christensen
sqlite-users@sqlite.org Sent: Friday, June 15, 2007 1:26:49 PM Subject: [sqlite] Optimization of equality comparison when NULL involved I am hoping there is an obvious answer to this that I've overlooked. I have two tables: create table tableA (path TEXT, value TEXT); create index myIndexA on tableA

[sqlite] Optimization of equality comparison when NULL involved

2007-06-15 Thread Sean Cunningham
I am hoping there is an obvious answer to this that I've overlooked. I have two tables: create table tableA (path TEXT, value TEXT); create index myIndexA on tableA (path, value); create table tableB(path TEXT, value TEXT); create index myIndexB on tableB (path, value); Now some simple