You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/03/03 07:33:11 UTC
[GitHub] [incubator-shardingsphere] lengyul opened a new issue #4580:
shardingsphere: Regarding routing to multiple data nodes,
when querying with aggregate functions (count, max, avg ...),
how to deal with the total statistics of multiple tables?
lengyul opened a new issue #4580: shardingsphere: Regarding routing to multiple data nodes, when querying with aggregate functions (count, max, avg ...), how to deal with the total statistics of multiple tables?
URL: https://github.com/apache/incubator-shardingsphere/issues/4580
## Question
**For English only**, other languages will not accept.
Before asking a question, make sure you have:
- Googled your question.
- Searched open and closed [GitHub issues](https://github.com/apache/incubator-shardingsphere/issues).
- Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
Please pay attention on issues you submitted, because we maybe need more details.
If no response **more than 7 days** and we cannot reproduce it on current information, we will **close it**.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] lengyul commented on issue #4580:
shardingsphere: Regarding routing to multiple data nodes,
when querying with aggregate functions (count, max, avg ...),
how to deal with the total statistics of multiple tables?
Posted by GitBox <gi...@apache.org>.
lengyul commented on issue #4580: shardingsphere: Regarding routing to multiple data nodes, when querying with aggregate functions (count, max, avg ...), how to deal with the total statistics of multiple tables?
URL: https://github.com/apache/incubator-shardingsphere/issues/4580#issuecomment-593909372
> Hi, @lengyul
> Can you explain your question with an example?
[example]
Sql statement:
select avg(column),max(column) from table where time between 0302 and 0303
Route to:
select avg(column),max(column) from table_0302
select avg(column),max(column) from table_0303
Returned their respective statistics(two data).
I want total statistics (a piece of data), do I need code to process it?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] terrymanu closed issue #4580:
shardingsphere: Regarding routing to multiple data nodes,
when querying with aggregate functions (count, max, avg ...),
how to deal with the total statistics of multiple tables?
Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #4580: shardingsphere: Regarding routing to multiple data nodes, when querying with aggregate functions (count, max, avg ...), how to deal with the total statistics of multiple tables?
URL: https://github.com/apache/incubator-shardingsphere/issues/4580
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] lengyul commented on issue #4580:
shardingsphere: Regarding routing to multiple data nodes,
when querying with aggregate functions (count, max, avg ...),
how to deal with the total statistics of multiple tables?
Posted by GitBox <gi...@apache.org>.
lengyul commented on issue #4580: shardingsphere: Regarding routing to multiple data nodes, when querying with aggregate functions (count, max, avg ...), how to deal with the total statistics of multiple tables?
URL: https://github.com/apache/incubator-shardingsphere/issues/4580#issuecomment-595028784
> Group query/aggregation is supported by ShardingSphere.
>
> In version 4.x, you can config precise algorithm for between statements.
>
> > We need to discuss this pull request:
> >
> > 1. For standard sharding strategy, user need config precise algorithm (for =, IN) and range algorithm (for BETWEEN AND, <, >, >=, <=). If range algorithm absent, the SQL contains BETWEEN should query all data nodes. That is correct, because user know they do not config range algorithm explicitly;
> > 2. For inline sharding strategy, user only can config precise algorithm via inline expression, and cannot config range algorithm. So throw exception when SQL contains BETWEEN may better than query all data nodes. If query all data nodes instead of explicit exception, user may missing the potential performance issue.
>
> In version 5.x of master branch(not release yet), you can directly config the follow parameter in server.yaml to allow between statement query in inline sharding.
>
> > allow.range.query.with.inline.sharding: true
Ok thank you, the problem has been solved.
I use version 4.0.0 Implements the doSharding method provided by RangeShardingAlgorithm.class.
However, some minor problems were found during use (not affecting my use), the following
1. ROUND(AVG(column),2) With function nesting,When routing multiple data nodes for queries, the results (multiple results) of the respective tables are returned instead of a total stat.
--
2.The SQL [order by $ {param}] param written by mybatis's mapper.xml is not recognized, the specific error message is: bad SQL grammar []; nested exception is java.sql.SQLException: No value specified for parameter x
Thanks again
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] kimmking commented on issue #4580:
shardingsphere: Regarding routing to multiple data nodes,
when querying with aggregate functions (count, max, avg ...),
how to deal with the total statistics of multiple tables?
Posted by GitBox <gi...@apache.org>.
kimmking commented on issue #4580: shardingsphere: Regarding routing to multiple data nodes, when querying with aggregate functions (count, max, avg ...), how to deal with the total statistics of multiple tables?
URL: https://github.com/apache/incubator-shardingsphere/issues/4580#issuecomment-596363237
OK, thanks for feedback.
We 'll close this issue later.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] kimmking commented on issue #4580:
shardingsphere: Regarding routing to multiple data nodes,
when querying with aggregate functions (count, max, avg ...),
how to deal with the total statistics of multiple tables?
Posted by GitBox <gi...@apache.org>.
kimmking commented on issue #4580: shardingsphere: Regarding routing to multiple data nodes, when querying with aggregate functions (count, max, avg ...), how to deal with the total statistics of multiple tables?
URL: https://github.com/apache/incubator-shardingsphere/issues/4580#issuecomment-593901941
Hi, @lengyul
Can you explain your question with an example?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] kimmking commented on issue #4580:
shardingsphere: Regarding routing to multiple data nodes,
when querying with aggregate functions (count, max, avg ...),
how to deal with the total statistics of multiple tables?
Posted by GitBox <gi...@apache.org>.
kimmking commented on issue #4580: shardingsphere: Regarding routing to multiple data nodes, when querying with aggregate functions (count, max, avg ...), how to deal with the total statistics of multiple tables?
URL: https://github.com/apache/incubator-shardingsphere/issues/4580#issuecomment-594024605
Group query/aggregation is supported by ShardingSphere.
In version 4.x, you can config precise algorithm for between statements.
> We need to discuss this pull request:
> 1. For standard sharding strategy, user need config precise algorithm (for =, IN) and range algorithm (for BETWEEN AND, <, >, >=, <=). If range algorithm absent, the SQL contains BETWEEN should query all data nodes. That is correct, because user know they do not config range algorithm explicitly;
> 2. For inline sharding strategy, user only can config precise algorithm via inline expression, and cannot config range algorithm. So throw exception when SQL contains BETWEEN may better than query all data nodes. If query all data nodes instead of explicit exception, user may missing the potential performance issue.
In version 5.x of master branch(not release yet), you can directly config the follow parameter in server.yaml to allow between statement query in inline sharding.
> allow.range.query.with.inline.sharding: true
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services