On Tue, Jun 15, 2010 at 08:58:22PM -0700, Roger Binns scratched on the wall:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 06/15/2010 07:59 PM, Simon Slavin wrote:
> > The standard assumption about SQLite is that it's faster to do your INSERTs 
> > first, then create the indices.
> 
> If the index is created first then the data in the table and the pages
> making up the index will be interleaved.  That is likely to lead to more and
> further seeks on accessing the index.  Creating the index afterwards will
> result in a contiguous sequence of pages (assuming no existing free pages).

  Contiguous, yes, but the pages may not be in any logical order.
  The internal node pages will get shuffled as the tree is built,
  meaning you might still have a significant number of seeks.

   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to