Search Postgresql Archives

Yet another "drop table vs delete" question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I was wondering if dropping a table is more efficient in PostgreSQL
8.x in comparison to deleting it's content ?

To put you in the picture - I want to schedule via cron job some daily
data materialization. With the resource I got there are only those two
ways:

1) DROP statement:
a) DROP TABLE tmp;
b) CREATE TABLE tmp AS select * from ....;

2) DELETE statement:
a) DELETE FROM tmp;
b) INSERT INTO tmp SELECT * from ....;

tmp table doesn't have any index nor constraints.

The thing is, postgresql may leave some invalid content behind in both
situations. The real question is - which of those two options leaves
less garbage to be vaccumed ? At this point I don't relay care about
cost based efficiency but cutting down pg background work.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux