Drop is executed within a transaction, which means that every record
you touch has to be backed up to the journal first, then modified in
the database.  I'm guessing that if you use pragma synchronous=off, it
would speed up the drop index, but you'd take a chance on corrupting
the database if the machine crashed during the drop.

It would probably be faster to make a copy of the database (all
sequential I/O), then drop the index with synchronous=off in one of
the copies (no journal I/O), then use vacuum if you want to really
clean up the DB.  If something goes wrong, you still have your backup
copy.

I haven't actually tried this; let us know if it makes a big difference.

Jim

On 3/17/09, Nikolas Stevenson-Molnar <steve...@evergreen.edu> wrote:
> Hi,
>
> I'm trying to drop an index on a table with about 8 million rows and
> it's taking a very long time. I can understand why building the index
> would take some time, but why dropping it? And is there any way to
> speed it up?
>
> Thanks!
> _Nik
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>


-- 
Software first.  Software lasts!
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to