pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: pgsql-performance@postgresql.org
Subject: Re: Performance of query
Date: Fri, 22 Mar 2013 14:13:50 -0700
Message-ID: <514CC98E.4050903@agliodbs.com> (raw)
In-Reply-To: <CAM_v1L0RL3Jg_N=gn4WwBzq5ro5s1-zye2qOpykvZcFFe40nYg@mail.gmail.com>
References: <CAM_v1L0RL3Jg_N=gn4WwBzq5ro5s1-zye2qOpykvZcFFe40nYg@mail.gmail.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

On 03/22/2013 12:46 PM, Cindy Makarowsky wrote:
> I've tried playing around with the settings in the config file for
> shared_buffers, work_mem, etc restarting Postgres each time and nothing
> seems to help.

Well, you're summarizing 55 million rows on an unindexed table:

"        ->  Seq Scan on busbase  (cost=0.00..6378172.28 rows=55402728
width=7) (actual time=0.004..250046.673 rows=60057057 loops=1)"

... that's where your time is going.

My only suggestion would be to create a composite index which matches
the group by condition on table1, and vacuum freeze the whole table so
that you can use index-only scan on 9.2.

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (10+ messages)  latest in thread

Message-ID: <514CC98E.4050903@agliodbs.com>
Permalink:  ../514CC98E.4050903@agliodbs.com/
Also on:    postgresql.org/message-id/514CC98E.4050903@agliodbs.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: josh@agliodbs.com
  Subject: Re: Performance of query
  In-Reply-To: <514CC98E.4050903@agliodbs.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