Re: [sqlite] Overhead of indexes?

2009-07-22 Thread Simon Slavin
On 23 Jul 2009, at 2:20am, Jim Showalter wrote: > The query looks like this: > > select distinct * from tbl where a <> 0 order by a desc, b desc, c > desc, d desc limit 2; > > where a, b, c, and d are all type INTEGER. To add to Igor's point, how much use an index is varies depending on how

Re: [sqlite] Overhead of indexes?

2009-07-22 Thread Igor Tandetnik
Jim Showalter wrote: > What is the overhead in O notation for adding an index to a column in > SQLite? You mean size overhead? O(n): the index is basically just another table (usually with fewer columns than the original). There's one record in the index for every record

[sqlite] Overhead of indexes?

2009-07-22 Thread Jim Showalter
I have everything working now, and am just tidying up. I want to add indexes, if needed, but this is for a cellphone app, and I'm worried about using up space, particularly when the data is unlikely to be more than a couple thousand rows in total. But there is a query that might be slow