Temporal Function Issues

Doherty, Adam adam.doherty at esso.ca
Wed Jun 13 17:18:11 CEST 2018


Hi Stefan:

Thanks for the quick reply.  Yes casting to a date sorts it out.
It's also much simpler.

I was unaware of cast in SQL.  Thank you for teaching me something new.

Adam


-----Original Message-----
From: users-list [mailto:users-list-bounces+adam.doherty=esso.ca at monetdb.org] On Behalf Of Stefan Manegold
Sent: Wednesday, June 13, 2018 09:03
To: Communication channel for MonetDB users <users-list at monetdb.org>
Subject: Re: Temporal Function Issues

Hi Adam,

did/could you try replacing

str_to_date(timestamp_to_str(event_timestamp, '%Y-%m-%d'), '%Y-%m-%d')

by a simple

cast(event_timestamp as date)

?

Best,
Stefan

----- On Jun 13, 2018, at 4:52 PM, Doherty, Adam adam.doherty at esso.ca wrote:

> Hello all:
> 
> I am trying to find the most efficient way to filter results for those matching
> today only.
> My events table has 550 million rows and I want a view as follows-
> 
> CREATE VIEW events_today AS SELECT * FROM events WHERE
> str_to_date(timestamp_to_str(event_timestamp, '%Y-%m-%d'), '%Y-%m-%d') =
> CURRENT_DATE which should give me all events with today's date.
> 
> Running the SELECT by itself also never returns.
> 
> However, the query just hangs without ever returning.
> 
> I'm running 11.29.3 (Mar2018) on CentOS 7 with 128GB and 16 Cores.
> 
> Adam
> _______________________________________________
> users-list mailing list
> users-list at monetdb.org
> https://www.monetdb.org/mailman/listinfo/users-list

-- 
| Stefan.Manegold at CWI.nl | DB Architectures   (DA) |
| www.CWI.nl/~manegold/  | Science Park 123 (L321) |
| +31 (0)20 592-4212     | 1098 XG Amsterdam  (NL) |
_______________________________________________
users-list mailing list
users-list at monetdb.org
https://www.monetdb.org/mailman/listinfo/users-list



More information about the users-list mailing list