Rel8 Performance x100 Slower than SQL #292
Replies: 8 comments
|
The first thing you should do is run both of these queries with |
|
|
I've just noticed that they are not quite equivalent: whereas |
|
@ocharles what do I say in Rel8 to get the equivalent of |
|
You can just pass a tuple of groupBy (pPeriodYear widgetsPerDay, pPeriodMonth widgetsPerDay)or maybe: groupBy (year (pPeriod widgetsPerDay), month (pPeriod widgetsPerDay))(but I don't know what |
|
This gives versus the hand-written |
|
Let me know if you need anything else. I am assuming that this is generated by Opaleye? |
|
I would imagine it's the join condition that's causing the problem. Your Rel8 one has a lot more going on with |
Uh oh!
There was an error while loading. Please reload this page.
I am using https://hackage.haskell.org/package/rel8-1.4.1.0 and have the following query in Haskell. Sadly it takes 180 seconds to run.
When I code up the SQL by hand it takes 3 seconds.
Here is what
showQuerygives me:It looks very slow because there’s a query inside a query inside another query: 5 sub queries? But I am an SQL noob. Maybe I mis-formulated the Haskell?
All reactions