[PERFORM] Planner is getting wrong row count

2013-04-02 Thread AI Rumman
Why is the following query getting wrong estimation of rows? I am using Postgresql 9.2.1 with default_statistics_target = 100. I execute vacuum analyze each night. explain analyze SELECT entity.id AS "Leads_id", entity.type AS "Leads_type" , leads.firstname AS "Leads_firstname", leads.lastname AS

Re: [PERFORM] Problems with pg_locks explosion

2013-04-02 Thread Armand du Plessis
It's now running as expected, I made a few other tweaks to get it to an operational state again. So just for closure on this dark period below some notes. There was two triggers that caused the almost instant backlog of locks. As suspected the one was scheduler that caused endless problems wheneve

Re: [PERFORM] Re: Join between 2 tables always executes a sequential scan on the larger table

2013-04-02 Thread Tom Lane
Igor Neyman writes: > The output of explain analyze (Postgres 9.2.3): > Hash Left Join (cost=111357.64..126222.29 rows=41396 width=42) (actual > time=1982.543..2737.331 rows=41333 loops=1) > Hash Cond: ((uc.user_id)::text = (u.id)::text) > -> Seq Scan on user_2_competition uc (cost=0.00..

[PERFORM] Re: Join between 2 tables always executes a sequential scan on the larger table

2013-04-02 Thread Igor Neyman
From: Dieter Rehbein [mailto:dieter.rehb...@skiline.cc] Sent: Tuesday, April 02, 2013 4:52 AM To: pgsql-performance@postgresql.org Subject: Join between 2 tables always executes a sequential scan on the larger table Hi everybody, in a project I have a performance problem, which I (and my collea

Re: [PERFORM] Problems with pg_locks explosion

2013-04-02 Thread Armand du Plessis
Jumped the gun a bit. the problem still exists like before. But it's definitely on the right track, below is the output from top in the seconds before the cluster locks up. For some reason still insisting on moving tasks around despite bumping the sched_migration_cost cost up to 100ms. 77 root

[PERFORM] Join between 2 tables always executes a sequential scan on the larger table

2013-04-02 Thread Dieter Rehbein
Hi everybody, in a project I have a performance problem, which I (and my colleagues) don't understand. It's a simple join between 2 of 3 tables: table-1: user (id, user_name, ...). This table has about 1 million rows (999673 rows) table-2: competition (57 rows) table-3: user_2_competi

Re: [PERFORM] Postgres upgrade, security release, where?

2013-04-02 Thread Mark Kirkwood
On 02/04/13 21:34, Dave Page wrote: On Mon, Apr 1, 2013 at 11:43 PM, Mark Kirkwood wrote: On 02/04/13 13:55, Bruce Momjian wrote: On Tue, Apr 2, 2013 at 09:40:07AM +0900, Ian Lawrence Barwick wrote: Due to the security nature of the release, the source and binaries will only be publicly av

Re: [PERFORM] Postgres upgrade, security release, where?

2013-04-02 Thread Dave Page
On Mon, Apr 1, 2013 at 11:43 PM, Mark Kirkwood wrote: > On 02/04/13 13:55, Bruce Momjian wrote: >> >> On Tue, Apr 2, 2013 at 09:40:07AM +0900, Ian Lawrence Barwick wrote: Due to the security nature of the release, the source and binaries will only be publicly available on April 4 -

Re: [PERFORM] Problems with pg_locks explosion

2013-04-02 Thread Armand du Plessis
Touch wood but I think I found the problem thanks to these pointers. I checked the vm.zone_reclaim_mode and mine was set to 0. However just before the locking starts I can see many of my CPUs flashing red and jump to high percentage sys usage. When I look at top it's the migration kernel tasks that