Re: Tuning to speed select - Mailing list pgsql-general

From Alban Hertroys
Subject Re: Tuning to speed select
Date
Msg-id 44DB0083.6060608@magproductions.nl
Whole thread Raw
In response to Re: Tuning to speed select  (Richard Broersma Jr <rabroersma@yahoo.com>)
List pgsql-general
Richard Broersma Jr wrote:
>> Views certainly help in managing complexity. They do nothing to improve
>> query-speed.
>>
>> Querying a view gets rewritten to queries to the underlying tables on the
>> fly.
>> (as long as there are no materialized views, which are still on a the TODO
>> list)
>
> Would partial indexs on the most queried regions of the table help in query speed?

They would, as long as they can be used in the client application
queries. If all the data is often used (partially or not), then there's
little point to partial indices. But that's a border-case. In common,
they can make major differences.

Also, make sure you add enough constraints to your query so that the
partial index constraints match your query constraints, otherwise the
index will not be used.

Another point to check; make sure you don't cause type casts over
indexed columns. That might (under certain conditions) cause a type cast
on the column value of every indexed row, which does slow down things
significantly. I believe this was solved in PostgreSQL 8.something.

--
Alban Hertroys
alban@magproductions.nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
    7500 AK Enschede

// Integrate Your World //

pgsql-general by date:

Previous
From: John Sidney-Woollett
Date:
Subject: Re: Importance of re-index
Next
From: Roger Mason
Date:
Subject: psycopg problem