Re: [SQL] SQL timestamp to date cast

2005-01-20 Thread Michael Fuhr
On Thu, Jan 20, 2005 at 11:41:41AM +0200, Andrei Bintintan wrote: > >Another possibility would be to create a functional index on datetime: > > > >CREATE INDEX user_action_date_idx ON user_action (date(datetime)); > > GREAT!!! I thought it is possible but I didn't knew how to make such > indexes.

Re: [SQL] SQL timestamp to date cast

2005-01-20 Thread Andrei Bintintan
chael Fuhr" <[EMAIL PROTECTED]> To: "Andrei Bintintan" <[EMAIL PROTECTED]> Cc: Sent: Thursday, January 20, 2005 11:33 AM Subject: Re: [SQL] SQL timestamp to date cast On Thu, Jan 20, 2005 at 10:52:50AM +0200, Andrei Bintintan wrote: SELECT DISTINCT(nummer) FROM user_action

Re: [SQL] SQL timestamp to date cast

2005-01-20 Thread Michael Fuhr
On Thu, Jan 20, 2005 at 10:52:50AM +0200, Andrei Bintintan wrote: > SELECT DISTINCT(nummer) > FROM user_action > WHERE datetime::date='11/11/2004' AND id_action IN (5,6,9) > > Now, datetime has the type timestamp. How can I make an index or write > different this query so that it runs faster? Yo

[SQL] SQL timestamp to date cast

2005-01-20 Thread Andrei Bintintan
Hi,   I have the following query:   SELECT DISTINCT(nummer) FROM user_action WHERE datetime::date='11/11/2004' AND id_action IN (5,6,9)   Now, datetime has the type timestamp. How can I make an index or write different this query so that it runs faster? It really takes some time sometimes.