On Sun, Jun 15, 2014 at 9:47 AM, Eric Rubin-Smith <eas....@gmail.com> wrote:

> Richard Hipp wrote:
>
> > What does this query return?
> >
> >      SELECT count(*) FROM ipIndex
> >       WHERE minD1 <= 1220818432 and 1220818432 <= maxD1
> >         AND minD2 <= 2120561472 and 2120561472 <= maxD2
> >         AND minD3 <= 1685398080 and 1685398080 <= maxD3
> >         AND minD4 <= 1685755328 and 1685755328 <= maxD4
> >         AND minD5 <= 538331072 and 538331072 <= maxD5;
>
> Hm, it returns 1645.  This indicates a bug (the max expected value is
> 128).  I'm now highly suspicious of my mathematical reasoning or my
> code.  I'll take a look.  Thanks, Richard!
>


Follow-up for those who are curious.  My program for randomly populating
the database was creating a bunch of identical bounding boxes for
short-length prefixes (i.e. prefixes corresponding to large bounding
boxes).  This made the R*Tree do a bunch of redundant work.  Eliminating
this issue led to a ~30x throughput improvement to ~6k searches per second
on a database with 100k prefixes in it.

After populating the database with 5.7 million such prefixes, we are at a
throughput of about 2.2kTPS.  Not horrible, and not sure I can expect much
more out of SQLite -- but still not good enough for my use case
(unfortunately).  Any further optimization tips are highly welcome.  In the
mean time, I'm going to keep digging.

Thanks again to Richard for pointing me in the right direction.

Eric
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to