pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Martin Foster <martin@ethereal-realms.org>
To: Stephan Szabo <sszabo@megazone23.bigpanda.com>
Cc: PostgreSQL Performance <pgsql-performance@postgresql.org>
Subject: Re: Efficiency of timestamps
Date: Tue, 08 Jul 2003 19:37:16 -0600
Message-ID: <3F0B71CC.1030106@ethereal-realms.org> (raw)
In-Reply-To: <20030708174923.X4603-100000@megazone23.bigpanda.com>
References: <20030708174923.X4603-100000@megazone23.bigpanda.com>

Stephan Szabo wrote:
> 
> 
> I think you might get better results with some kind of multi-column index.
> It's using the index to avoid a sort it looks like, but it's not helping
> to find the conditions. I can't remember the correct ordering, but maybe
> (posttimestamp, realmname, postidnumber).  Having separate indexes on the
> fields won't help currently since only one index will get chosen for the
> scan.  Also, what does explain analyze show?
> 

Hope that shed's light on the matter.

  Limit  (cost=0.00..260237.32 rows=100 width=48) (actual 
time=68810.26..68820.83 rows=55 loops=1)
    ->  Index Scan using pkpost on post  (cost=0.00..3020594.00 
rows=1161 width=48) (actual time=68810.25..68820.72 rows=55 loops=1)
          Filter: ((posttimestamp > (('now'::text)::timestamp(6) without 
time zone - '00:10'::interval)) AND (realmname = 'Amalgam'::character 
varying) AND ((postto = 'all'::character varying) OR (postto = 
'root'::character varying)) AND ((NOT (subplan)) OR (puppeteerlogin IS 
NULL)) AND ((NOT (subplan)) OR (puppetname IS NULL)))
          SubPlan
            ->  Index Scan using pkpuppetignore on puppetignore 
(cost=0.00..13.31 rows=1 width=10) (actual time=0.02..0.02 rows=0 loops=55)
                  Index Cond: (puppeteerlogin = 'root'::character varying)
                  Filter: ((puppetignore = 'global'::character varying) 
AND (puppetlogin = $0))
            ->  Index Scan using pkpuppetignore on puppetignore 
(cost=0.00..5.84 rows=1 width=15) (actual time=0.01..0.01 rows=0 loops=55)
                  Index Cond: ((puppeteerlogin = 'root'::character 
varying) AND (puppetname = $1))
                  Filter: (puppetignore = 'single'::character varying)
  Total runtime: 68821.11 msec

-- 
	Martin Foster
	Creator/Designer Ethereal Realms
	martin@ethereal-realms.org





view thread (7+ messages)  latest in thread

Message-ID: <3F0B71CC.1030106@ethereal-realms.org>
Permalink:  ../3F0B71CC.1030106@ethereal-realms.org/
Also on:    postgresql.org/message-id/3F0B71CC.1030106@ethereal-realms.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: martin@ethereal-realms.org, sszabo@megazone23.bigpanda.com
  Subject: Re: Efficiency of timestamps
  In-Reply-To: <3F0B71CC.1030106@ethereal-realms.org>
  References: <20030708174923.X4603-100000@megazone23.bigpanda.com> <3F0B71CC.1030106@ethereal-realms.org>

* 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