You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have question about SQL plan/engine. Do u have any plan about supportting cross-shards avg function? From my perspective, this is similar to the distinct_count or distinct_sum.
Feature Description
If there is a cross shards SQL:
SELECTuser.name, avg(user.age) FROM user GROUP BYuser.name
we can modify it into Route as:
SELECTuser.name, sum(user.age), count(user.age) FROM user GROUP BYuser.nameORDER BYuser.name
And the OrderedAggregate can compute avg value by utilizing the ordered result from Route, which is similar to the distinct_count.
Use Case(s)
SELECT user.name, avg(user.age) FROM user GROUP BY user.name
My solution is just a discussion. I know there are some other challenges I haven't considered. If there are some incorrect points, pls figure them out.
thx
The text was updated successfully, but these errors were encountered:
Hi Vitess developers,
I have question about SQL plan/engine. Do u have any plan about supportting cross-shards avg function? From my perspective, this is similar to the distinct_count or distinct_sum.
Feature Description
If there is a cross shards SQL:
we can modify it into Route as:
And the OrderedAggregate can compute avg value by utilizing the ordered result from Route, which is similar to the distinct_count.
Use Case(s)
SELECT user.name, avg(user.age) FROM user GROUP BY user.name
My solution is just a discussion. I know there are some other challenges I haven't considered. If there are some incorrect points, pls figure them out.
thx
The text was updated successfully, but these errors were encountered: