Re: Postgres not using array - Mailing list pgsql-performance

From Gregory Stark
Subject Re: Postgres not using array
Date
Msg-id 87myj5jqc5.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: Postgres not using array  (André Volpato<andre.volpato@ecomtecnologia.com.br>)
Responses Re: Postgres not using array  (André Volpato<andre.volpato@ecomtecnologia.com.br>)
List pgsql-performance
André Volpato <andre.volpato@ecomtecnologia.com.br> writes:

> Tom Lane escreveu:
>>> We are guessing that a dual core 3.0GHz will beat up a quad core 2.2,
>>> at least in this environmnent with less than 4 concurrent queryes.
>>
>> The most you could hope for from that is less than a 50% speedup.  I'd
>> suggest investing some tuning effort first.  Some rethinking of your
>> schema, for example, might buy you orders of magnitude ... with no new
>> hardware investment.
>
> I think we almost reached the tuning limit, without changing the schema.

It's hard to tell from the plan you posted (and with only a brief look) but it
looks to me like your query with that function is basically doing a join but
because the inner side of the join is in your function's index lookup it's
effectively forcing the use of a "nested loop" join. That's usually a good
choice for small queries against big tables but if you're joining a lot of
data there are other join types which are much faster. You might find the
planner can do a better job if you write your query as a plain SQL query and
let the optimizer figure out the best way instead of forcing its hand.


--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's On-Demand Production Tuning

pgsql-performance by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: The state of PG replication in 2008/Q2?
Next
From: Peter Schuller
Date:
Subject: Identifying the nature of blocking I/O