Temporal Function Issues

Stefan Manegold Stefan.Manegold at cwi.nl
Wed Jun 13 17:02:37 CEST 2018


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) |


More information about the users-list mailing list