[BUGS] pg_dump is O(N) in DB table count N even if dumping only one table

2013-06-10 Thread Gunnlaugur Thor Briem
Hi, pg_dump takes O(N) time dumping just one table (or a few) explicitly specified with a -t parameter. It thus becomes painfully slow on a database with very many tables. (The use case is copying a few tables over to a test DB, from a large production data warehouse.) The three queries taking O

Re: [BUGS] pg_dump is O(N) in DB table count N even if dumping only one table

2013-06-10 Thread Tom Lane
Gunnlaugur Thor Briem writes: > pg_dump takes O(N) time dumping just one table (or a few) explicitly > specified with a -t parameter. It thus becomes painfully slow on a database > with very many tables. This is not a bug. It needs information about all the tables anyway to deal with dependencie

Re: [BUGS] pg_dump is O(N) in DB table count N even if dumping only one table

2013-06-10 Thread Andres Freund
On 2013-06-10 13:28:32 +, Gunnlaugur Thor Briem wrote: > Hi, > > pg_dump takes O(N) time dumping just one table (or a few) explicitly > specified with a -t parameter. It thus becomes painfully slow on a database > with very many tables. > > (The use case is copying a few tables over to a test

Re: [BUGS] pg_dump is O(N) in DB table count N even if dumping only one table

2013-06-10 Thread Gunnlaugur Thor Briem
OK, that was what I thought at first, but then I read this note in `man pg_dump`: When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. so I supposed that that dependency information was *not* required. So I posted the

Re: [BUGS] pg_dump is O(N) in DB table count N even if dumping only one table

2013-06-10 Thread Gunnlaugur Thor Briem
On Mon, Jun 10, 2013 at 2:08 PM, Andres Freund wrote: > On 2013-06-10 13:28:32 +, Gunnlaugur Thor Briem wrote: > > The three queries taking O(N) time are listed below. AFAICT each of these > > Which of those queries take how long in your case? > They were as follows: duration: 27770.917 ms

Re: [BUGS] pg_dump is O(N) in DB table count N even if dumping only one table

2013-06-10 Thread Andres Freund
Hi, On 2013-06-10 14:24:14 +, Gunnlaugur Thor Briem wrote: > So I ran this again locally on the production server: > > duration: 16012.518 ms statement: SELECT c.tableoid, c.oid, c.relname, ... > duration: 16516.708 ms statement: SELECT tableoid, oid, typname, ... > duration: 13400.694 ms

Re: [BUGS] pg_dump is O(N) in DB table count N even if dumping only one table

2013-06-10 Thread Gunnlaugur Thor Briem
On Mon, Jun 10, 2013 at 2:38 PM, Andres Freund wrote: > Hm. 13s for pg_depend locally vs 55s remotely. You need to have a > tremendous amount of dependencies. > Could you do a count(*) of pg_depend, pg_type and pg_class? > Yep, there's rather a lot: select count(*) from pg_depend; 7692365 sele

Re: [BUGS] bug in Prepared statement with DELETE RETURNING and rule on view

2013-06-10 Thread Tom Lane
[ got around to looking at this thread finally ] Amit Kapila writes: > What happens when you change ON DELETE rule of the view that really deletes > elements is that command type after applying rule remains same which means > Delete, so it can set the Tag. The point here is that in extended-quer

Re: [BUGS] Completely broken replica after PANIC: WAL contains references to invalid pages

2013-06-10 Thread Sergey Konoplev
Hi, On Thu, May 9, 2013 at 7:28 PM, Sergey Konoplev wrote: > On Tue, Apr 2, 2013 at 11:26 AM, Andres Freund wrote: >> The attached patch fixes this although I don't like the way it knowledge of >> the >> point up to which StartupSUBTRANS zeroes pages is handled. > > One month has passed since t

Re: [BUGS] Completely broken replica after PANIC: WAL contains references to invalid pages

2013-06-10 Thread Simon Riggs
On 11 June 2013 04:36, Sergey Konoplev wrote: > Hi, > > On Thu, May 9, 2013 at 7:28 PM, Sergey Konoplev wrote: >> On Tue, Apr 2, 2013 at 11:26 AM, Andres Freund >> wrote: >>> The attached patch fixes this although I don't like the way it knowledge of >>> the >>> point up to which StartupSUBTRA