Extremely slow order by queries

Hi, I have a scenario where data size is ~3M rows. My query is select C1, C2, C3 from T1 group by C1,C2,C3 This returns result in 30 Sec ( number of groups around 1 M ) While, if I modify the query to select C1, C2, C3 from T1 group by C1,C2,C3 Order by C1, C2 on the same dataset, it takes ~ 1 hour to get result. The platforms I tried is both widows 64 bit and Linux 64 bit, with latest monet installed. Both the machines have 4 cores. And the behavior is same on both the machines. I am really surprised to see overhead of second query. One more observation is that this query occupies only single core, while monet is free to utilize 4 cores. Regards, Manish

Hello Manish, How much memory do the machines have? Are they virtual machines? If yes, how much hardware resources do you have on the physical machine? What is the schema of table T1? You can prefix your queries with the keyword TRACE to get a breakdown of where the time has been spent. Does the query with ORDER BY only use 1 core for the whole query? Does the first query use multiple cores? Can you prefix both queries with the keyword EXPLAIN and send us the resulting physical execution plan? Regards, Jennie
On 9 Jul 2017, at 16:29, Manish gupta
wrote: Hi, I have a scenario where data size is ~3M rows. My query is select C1, C2, C3 from T1 group by C1,C2,C3 This returns result in 30 Sec ( number of groups around 1 M )
While, if I modify the query to select C1, C2, C3 from T1 group by C1,C2,C3 Order by C1, C2
on the same dataset, it takes ~ 1 hour to get result. The platforms I tried is both widows 64 bit and Linux 64 bit, with latest monet installed. Both the machines have 4 cores. And the behavior is same on both the machines.
I am really surprised to see overhead of second query. One more observation is that this query occupies only single core, while monet is free to utilize 4 cores.
Regards, Manish _______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
participants (2)
-
Manish gupta
-
Ying Zhang