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

From Shane Ambler
Subject Re: Data comparison SQL in PG 8.2.9
Date
Msg-id 496B6AD9.4070009@Sheeky.Biz
Whole thread Raw
In response to Data comparison SQL in PG 8.2.9  ("Phoenix Kiula" <phoenix.kiula@gmail.com>)
List pgsql-general
Phoenix Kiula wrote:

>                                 Table "public.users"
>           Column         |            Type             |
> Modifiers
>   -----------------------+-----------------------------+------------------------------
>       modify_date           | timestamp without time zone |
>   ....
>   Indexes:
>       "new_idx_modify_date" btree (modify_date) WITH (fillfactor=75)
>
>
> Any ideas why? I ran an explain analyze and this is the output:

> Another weird thing is that a query that has ">" a certain
> modify_date, even just yesterday as the date condition, takes a LONG
> time and is almost unusable.

Have you tried REINDEX? VACUUM ANALYZE since the update?
Not sure the security fix relating to indexes in 8.2.6 affects you.

Did the suggestion of adding the type cast affect the query?
If so then maybe the planner is now running the type conversion per row
instead of a one off from the constant in the select.



--

Shane Ambler
pgSQL (at) Sheeky (dot) Biz

Get Sheeky @ http://Sheeky.Biz

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: How do I 'include' a stored procedure in a SQL script file
Next
From: "Dan Armbrust"
Date:
Subject: Re: Slow Vacuum was: vacuum output question