pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mitch Vincent <mitch@venux.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: Timestamp indexes
Date: Fri, 21 Jul 2000 11:53:25 -0400
Message-ID: <007701bff32b$ce21d410$4100000a@doot> (raw)
References: <001d01bff323$39cdb250$4100000a@doot>
	<13354.964192504@sss.pgh.pa.us>

select * from applicants as a where (a.created::date > '05-01-2000' or
a.resubmitted::date > '05-01-2000') order by (case when a.resubmitted >
a.created then a.resubmitted else a.created end) desc limit 10 offset 0

There is one of the queries.. I just remembered that the order by was added
since last time I checked it's PLAN (in the 6.5.X days) -- could that be the
problem?

8784 records in the applicant database.

created and resubmitted are both timestamps.

NOTICE:  QUERY PLAN:

Sort  (cost=2011.65..2011.65 rows=4880 width=611)
  ->  Seq Scan on applicants a  (cost=0.00..1712.68 rows=4880 width=611)

ProcessQuery
! system usage stats:
!       7.489270 elapsed 5.609119 user 1.730936 system sec
!       [5.618921 user 1.750540 sys total]
!       1/546 [1/546] filesystem blocks in/out
!       0/9287 [0/9496] page faults/reclaims, 0 [0] swaps
!       0 [0] signals rcvd, 0/3 [3/6] messages rcvd/sent
!       7/102 [10/105] voluntary/involuntary context switches
! postgres usage stats:
!       Shared blocks:          0 read,          0 written, buffer hit rate
= 100.00%
!       Local  blocks:          0 read,          0 written, buffer hit rate
= 0.00%
!       Direct blocks:          0 read,          0 written
CommitTransactionCommand

Thanks Tom!


-Mitch






view thread (6+ messages)  latest in thread

Message-ID: <007701bff32b$ce21d410$4100000a@doot>
Permalink:  ../007701bff32b$ce21d410$4100000a@doot/
Also on:    postgresql.org/message-id/007701bff32b$ce21d410$4100000a@doot

 · 

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-sql@postgresql.org
  Cc: mitch@venux.net, tgl@sss.pgh.pa.us
  Subject: Re: Timestamp indexes
  In-Reply-To: <007701bff32b$ce21d410$4100000a@doot>
  References: <001d01bff323$39cdb250$4100000a@doot> <13354.964192504@sss.pgh.pa.us> <007701bff32b$ce21d410$4100000a@doot>

* 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