Am 21.11.2009 um 04:48 schrieb Phil Longstaff:

> sqlite> explain query plan SELECT DISTINCT t.* FROM transactions AS  
> t, splits
> AS s WHERE s.tx_guid=t.guid AND
> s.account_guid='e3ea8186deb3a9c160ab3b9409ea618f';
> 0|0|TABLE transactions AS t WITH INDEX  
> sqlite_autoindex_transactions_1 ORDER
> BY
> 1|1|TABLE splits AS s
> sqlite>
>
> Hmmm...  There are indices.  I recently modified the splits table,  
> removing
> "NOT NULL" from a column.  I then copied the data into the new table  
> using:
>
> CREATE TABLE splits_new (...)
> INSERT INTO splits_new SELECT FROM splits
> DROP TABLE splits
> ALTER TABLE splits_new RENAME TO splits
>
> How can I force the indices to be regenerated?

You dropped the table splits, which implicitly also dropped any  
indices associated with that table.
You'll have to recreate the indices after recreating a table using the  
standard 'CREATE INDEX ...' SQL statement.

</jum>


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

Reply via email to