Hi, The row_number() approach is slower. The inner query by itself (the one you posted above) takes around 1 sec. The whole temporary table creation and query execution that I showed before takes almost half of it so, I'd rather stick with that. The only problem is that I can't use it as a subquery, I need to use an indermediate variable in between. Is there any way to "delete" the variable after I use it ? I know its lifetime is up to the end of user session but are there any other options ? I didn't see anything in the manual. If I won't find any workaround I'll declare a stored procedure. Cheers, Dimitris On Wed, Jul 2, 2014 at 11:03 PM, Robin Cijvat < robin.cijvat@monetdbsolutions.com> wrote:
Hi Dimitris,
Good to hear that you got it to work. I would not know why putting the aggregation in the where clause would cause this behavior. When you said that it seems to have a better execution time, did you mean the original temporary table approach vs the working temporary table approach or the temporary table approach vs the row_number() approach?
Cheers, Robin
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list