Lee Crain wrote:
> 
> The reason I was wondering about indexing is that the indexes contain
> exactly the same data as is in the table and this seemed like an
> unnecessary duplication of data. 
> 

Actually this can be beneficial at least speed wise. SQLite has an 
optimization that will return data directly from the index where 
possible. This eliminates the extra work of using the rowid in the index 
entry to locate the row in the table (an O(log N) operation) so that it 
can retrieve the unindexed column data. If all your data is duplicated 
in the index, it can always use this optimization, and will in fact 
never pull data from the table itself for a query that uses the index. 
The table (along with the index) will only be accessed when rows are 
inserted, updated, or deleted.

Dennis Cote
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to