Re: [HACKERS] Date operations - Mailing list pgsql-hackers

From Thomas Lockhart
Subject Re: [HACKERS] Date operations
Date
Msg-id 37024B8F.DE7CE2EE@alumni.caltech.edu
Whole thread Raw
In response to Date operations  (Oliver Smith <oliver@kfs.org>)
List pgsql-hackers
> Question 3:
> Because this query gets hit a lot, would it make sense to create an
> index
>  CREATE INDEX tbl_robot_logs_at_age_idx ON tbl_robot_logs
>   ( AGE(at) );

Nope, since "age" is calculated from "now", which is alway changing.
You can't make a useful index on a non-constant expression or
function.
                       - Tom


pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: [HACKERS] Date operations
Next
From: Clark Evans
Date:
Subject: Bug Report - alter table does not work on temporary tables