Oh interesting! Is that optimization documented anywhere (website, code, or
otherwise)?

Ben

On Sat, Jun 9, 2018 at 10:36 AM Simon Slavin <[email protected]> wrote:

> On 9 Jun 2018, at 4:28pm, Jay Kreibich <[email protected]> wrote:
>
> > If a full VACUUM is not feasible, you can simply copy the table after
> the column is removed.
>
> Note that SQLite has special optimization for the command
>
>         DELETE FROM oldTable
>
> with no "WHERE" clause.  So the best way to do it would be
>
>         BEGIN;
>         CREATE tempTable AS SELECT * FROM oldTable;
>         DELETE FROM oldTable;
>         INSERT INTO oldTable SELECT * FROM tempTable;
>         COMMIT;
>
> Of course, if this is the master table for a foreign key, you have
> additional problems.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


-- 
Ben
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to