Wow! 
-
-
-
Replying to @l_avrot @pg_xocolatl and
Well, I'd love to hear why it's so significant. Am I doing something substantially wrong in my benchmark? Can you folks reproduce it? Code here:https://gist.github.com/lukaseder/2611212b23ba40d5f828c69b79214a0e …
2 replies 0 retweets 2 likes -
Replying to @lukaseder @l_avrot and
I've tested this on occasion in the past. The problem is that the relative performance in benchmarks will depend wholly on the fraction of the time attributable to count(), so it's never the same between different queries.
1 reply 0 retweets 0 likes -
Replying to @RhodiumToad @lukaseder and
Picking a single query and measuring the overhead specific to count() (this isn't simple) suggests that in fact, count(1) is 50% slower than count(*): on the machine I tested on, this is roughly 4 ns for count(*) and 6 ns for count(1)
1 reply 0 retweets 0 likes -
Replying to @RhodiumToad @lukaseder and
But the rest of the query usually drowns that out; e.g. in my tests that represented a difference of 2 seconds for a query taking 47 seconds
1 reply 0 retweets 0 likes -
Replying to @RhodiumToad @lukaseder and
For example, consider the performance difference between "select count(1) from ...", "select count(1), count(2) from ...", and "select count(1), count(*) from ..." on the same input. (Note that the two count() calls MUST be different or they will be combined)
1 reply 0 retweets 0 likes -
Replying to @RhodiumToad @l_avrot and
2/47 seconds is still 5%, though. Does the parser have some pre-existing way of recognising constant expressions like "1"? Might be a low hanging fruit... It probably isn't, as these things are often more complicated than it seems from the outside.
2 replies 0 retweets 0 likes -
Replying to @lukaseder @l_avrot and
The fact that the expression is constant (and the planner knows this) doesn't mean that we can avoid actually setting up the value at runtime (and checking it for nullity). The parameter is never actually used, but we don't know that unless we hardcode assumptions about count()
2 replies 0 retweets 0 likes -
Replying to @RhodiumToad @lukaseder and
Surely we could do it with SupportRequestSimplify, no?
1 reply 0 retweets 0 likes
unless I'm missing something, we don't call that for aggs
-
-
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
