Re: Data comparison SQL in PG 8.2.9 - Mailing list pgsql-general

From Thomas Markus
Subject Re: Data comparison SQL in PG 8.2.9
Date
Msg-id 496B074D.4000004@proventis.net
Whole thread Raw
In response to Re: Data comparison SQL in PG 8.2.9  ("Phoenix Kiula" <phoenix.kiula@gmail.com>)
List 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

pgsql-general by date:

Previous
From: "Phoenix Kiula"
Date:
Subject: Re: Data comparison SQL in PG 8.2.9
Next
From: Reg Me Please
Date:
Subject: Re: Data comparison SQL in PG 8.2.9