Jay A. Kreibich wrote:
> On Thu, Apr 10, 2008 at 05:58:59PM -0700, Richard Klein scratched on the wall:
> 
>> My advice would be to try it and see.  If table creation takes too long,
>> you can always remove the UNIQUE constraint, and then write a routine to
>> check the table for uniqueness after it's created.
> 
>   That "routine" could simply be creating an explicit unique index on
>   the column after all the data is loaded.  If the index can be
>   created, you're good to go.
> 
>   This is still a slow process, but I know the creation of indexes on
>   existing tables is one area the development team hopes to speed up.
>   I'm not sure what the priority of that is, however.
> 
>    -j
> 

Wouldn't this take just as long as creating the index immediately after
creating the table, and then letting each INSERT update the index?

Creating the index after all the data is loaded requires that the first
row be inserted into the index Btree, then the second row be inserted
into the Btree at the proper place, then the third row, and so on,
re-balancing the Btree as necessary.

Isn't this exactly the same process that takes place when you create
the index first and then insert each row?

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

Reply via email to