Re: Query Performance question

From: Tomas Vondra <tv(at)fuzzy(dot)cz>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Query Performance question
Date: 2014-07-14 00:58:08
Message-ID: 53C32B20.8010100@fuzzy.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 14.7.2014 00:55, Magers, James wrote:
> I am using a Pentaho process to access the database and select the
> appropriate information to update the DB tables and records. I am
> trying to select the previous subscription key in order to update the
> factable for any records that have the previous key to have the current
> subscription key. This query is intended to use the current subscription
> key and subscription info to select the previous subscription key to
> allow for the information to be updated. I would like to optimize the
> query to execute more efficiently.
>
> The database table has about 60K records in it and when I run an explain
> anaylyze it indicates that the query optimizer chooses to execute a
> bitmap heap scan, this seems like an inefficient method for this query.

Why do you think it's inefficient? The planner thinks it's efficient,
for some reason. And it's impossible to say if that's a good decision,
because we don't know (a) the explain plan, and (b) structure of the
table involved (indexes, ...).

Please post the explain analyze output to explain.depesz.com and post
the link here (it's more readable than posting it here directly).

Also, please do this:

SELECT relname, relpages, reltuples
FROM pg_class WHERE relname = 'member_subscription_d'

and this

\d member_subscription_d

and post the results here.

regards
Tomas

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Magers, James 2014-07-14 02:20:49 Re: Query Performance question
Previous Message Magers, James 2014-07-13 22:55:42 Query Performance question