On 3/4/17, Joshua Grauman <jnf...@grauman.com> wrote: > Hello all, > > I am wondering what would be faster for sqlite- Suppose I have a table > with ~400,000 rows and ~20 columns. Suppose I only care about read speed > of the table, and that each of the columns contains 8-bit or 32-bit > integers, and the first column is an ID for the row. Suppose I also have > an index on the first column.
If the ID column is an INTEGER PRIMARY KEY, then the index will be pointless, will take up space and slow down INSERT and UPDATE operations, but will never actually be used for queries. > If I only use the first 3 of the columns > regularly and only really want to optimize the speed of reading those > first 3 columns, would it make sense to split the table into two tables, > where the first column (the ID) is identical, but the first table only has > the first 3 columns and the second table has the rest of the columns. > Would that make reading the smaller table with only the 3 columns > noticably faster (due to less page faults/etc.)? > Yes, possibly so. I don't know by how much, but it does make since that queries would be faster this way. -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users