Re: Data comparison SQL in PG 8.2.9

From: Thomas Markus <t(dot)markus(at)proventis(dot)net>
To: Phoenix Kiula <phoenix(dot)kiula(at)gmail(dot)com>
Cc: PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Data comparison SQL in PG 8.2.9
Date: 2009-01-12 09:03:09
Message-ID: 496B074D.4000004@proventis.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

check explain analyze

tried this on 8.3 with real life data:

-- all rows, index useless
explain analyze select id from cl_customer where modified > '2008-01-01'

Seq Scan on cl_customer (cost=0.00..38958.79 rows=1448639 width=8)
(actual time=0.030..682.940 rows=1448783 loops=1)
Filter: (modified > '2008-01-01 00:00:00'::timestamp without time zone)
Total runtime: 1015.394 ms

-- small subset
explain analyze select id from cl_customer where modified > '2009-01-01'
Index Scan using i_cl_customer_modified on cl_customer
(cost=0.00..12.93 rows=144 width=8) (actual time=0.018..0.110 rows=175
loops=1)
Index Cond: (modified > '2009-01-01 00:00:00'::timestamp without time
zone)
Total runtime: 0.169 ms

Phoenix Kiula schrieb:
> Thanks. But it used to work without this, and more importantly, this
> doesn't explain why the ">" queries are so exceedingly slow now! Any
> thoughts?
>

Attachment Content-Type Size
t_markus.vcf text/x-vcard 255 bytes

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Reg Me Please 2009-01-12 09:11:48 Re: Data comparison SQL in PG 8.2.9
Previous Message Phoenix Kiula 2009-01-12 08:40:22 Re: Data comparison SQL in PG 8.2.9