pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: David Jaquay <djaquay@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Query across a date range
Date: Fri, 7 Jan 2005 11:35:11 -0800
Message-ID: <200501071135.11229.josh@agliodbs.com> (raw)
In-Reply-To: <ad4aa5a805010711171a3c1696@mail.gmail.com>
References: <20050107182106.6CBEC5AF685@svr4.postgresql.org>
	<ad4aa5a805010711171a3c1696@mail.gmail.com>

David,

> The problem: Doing a query for a date range on a particular store or
> market, though, for a date range of more than a few days does a
> sequential scan of sales_tickets, and performs worse than doing one
> single date query for each date.  My 'explain' for one such query is
> below.

Can you run EXPLAIN ANALYZE instead of just EXPLAIN?  That will show you the 
discrepancy between estimated and actual costs, and probably show you what 
needs fixing.

-- 
--Josh

Josh Berkus
Aglio Database Solutions
San Francisco



view thread (5+ messages)  latest in thread

Message-ID: <200501071135.11229.josh@agliodbs.com>
Permalink:  ../200501071135.11229.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200501071135.11229.josh@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, djaquay@gmail.com
  Subject: Re: Query across a date range
  In-Reply-To: <200501071135.11229.josh@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