pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tv@fuzzy.cz>
To: Marcus Engene <mengpg2@engene.se>
Cc: pgsql-performance@postgresql.org
Subject: Re: Performance Problem with postgresql 9.03, 8GB RAM,Quadcore Processor Server--Need help!!!!!!!
Date: Tue, 1 Nov 2011 14:13:34 +0100
Message-ID: <c759e7996874c981952264043aa8a5ee.squirrel@sq.gransy.com> (raw)
In-Reply-To: <4EAFC29A.40509@engene.se>
References: <CACBfhZPO1GJv4nVunPXGA2EZq923On-CBGtxyhtQYAaSMCuBEQ@mail.gmail.com>
	<CAF-3MvOjY17pVZXSWgYDB5dMy-B07KiVYexR4RRutxZyXeKjbA@mail.gmail.com>
	<CACBfhZNBwjB=3xQrvqy6ManJUaRyKEOoV8dMv7jJYPtXn9XFcQ@mail.gmail.com>
	<CACBfhZNr5qnMN0=8hp1Fb3hA8jwoEXnJAahua1JT5f5gXT9tuA@mail.gmail.com>
	<4EAFC29A.40509@engene.se>

On 1 Listopad 2011, 10:57, Marcus Engene wrote:
> Hi Hashim,
>
> One workaround I've done is if something looking like this....
>
> select
>      ...
> from
>      table_linking_massive_table tlmt
>     ,massive_table mt
>     ,some_table1 st1
>     ,some_table2 st2
>     ,some_table3 st3
>     ,some_table4 st4
> where
>      tlmt.group_id = 123223 AND
>      mt.id = tmlt.massive_table AND
>      st1.massive_table = mt.id AND
>      st2.massive_table = mt.id AND
>      st3.massive_table = mt.id AND
>      st4.massive_table = mt.id
>
> ...suddenly gets slow, it has helped to rewrite it as....
>
> select
>      ...
> from
>      (
>          select
>              ...
>          from
>              table_linking_massive_table tlmt
>             ,massive_table mt
>          where
>              tlmt.group_id = 123223 AND
>              mt.id = tmlt.massive_table AND
>      ) as mt
>     ,some_table1 st1
>     ,some_table2 st2
>     ,some_table3 st3
>     ,some_table4 st4
> where
>      tlmt.group_id = 123223 AND
>      mt.id = tmlt.massive_table AND
>      st1.massive_table = mt.id AND
>      st2.massive_table = mt.id AND
>      st3.massive_table = mt.id AND
>      st4.massive_table = mt.id
>

Can you please post EXPLAIN ANALYZE of those queries? It's difficult to
see what's wrong when we don't know the plan (and the actual stats
gathered during execution). Use explain.depesz.com to post the output.

Tomas




view thread (23+ messages)  latest in thread

Message-ID: <c759e7996874c981952264043aa8a5ee.squirrel@sq.gransy.com>
Permalink:  ../c759e7996874c981952264043aa8a5ee.squirrel@sq.gransy.com/
Also on:    postgresql.org/message-id/c759e7996874c981952264043aa8a5ee.squirrel@sq.gransy.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tv@fuzzy.cz, mengpg2@engene.se
  Subject: Re: Performance Problem with postgresql 9.03, 8GB RAM,Quadcore Processor Server--Need help!!!!!!!
  In-Reply-To: <c759e7996874c981952264043aa8a5ee.squirrel@sq.gransy.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox