Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] Date operations

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Oliver Smith <oliver(at)kfs(dot)org>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Date operations
Date: 1999-03-31 16:21:35
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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

                        - Tom

In response to

pgsql-hackers by date

Next:From: Clark EvansDate: 1999-03-31 16:22:40
Subject: Bug Report - alter table does not work on temporary tables
Previous:From: Thomas LockhartDate: 1999-03-31 16:19:54
Subject: Re: [HACKERS] Date operations

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group