[PERFORM] Using a window function in a view

2013-02-28 Thread Chris Hanks
I'm trying to create a view that uses a window function, but it seems that Postgres is apparently unable to optimize it. Here's a reproduction of my situation with 9.2.2: --- drop table if exists values cascade; create table values ( fkey1 integer not null, fkey2 integer not null, fkey3 integer n

[PERFORM] Re: PostgreSQL db, 30 tables with number of rows < 100 (not huge) - the fastest way to clean each non-empty table and reset unique identifier column of empty ones.

2012-07-06 Thread Chris Hanks
Daniel Farina-4 wrote > > On Fri, Jul 6, 2012 at 4:29 AM, Craig Ringer wrote: >> 1) Truncate each table. It is too slow, I think, especially for empty >> tables. >> >> Really?!? TRUNCATE should be extremely fast, especially on empty tables. >> >> You're aware that you can TRUNCATE m