Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to query statistics after database sub-database and sub-table?

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Database sub-database and sub-table is one of the ways to alleviate the pressure of database server and increase concurrency, but with the sub-database and sub-table, it inevitably brings some problems, the obvious problem is how to solve the query statistics after sub-database. After the sub-library, there is no SQL to use, simple filtering and then merging can also be done, but grouping will be very troublesome, it is necessary to group the sub-libraries into groups and gather sets and then group them together. This is a challenge for many java application programmers. However, the amount of data is too large to divide the database, so it is in a dilemma.

At this time, it is easy to use the aggregator to do the summary calculation in the next step, such as the grouping summary problem just mentioned, which can be written out in just a few lines:

ABC1= [connect ("orclA"), connect ("orclB")]

/ connect multiple data sources 2select sales.dept,sum (orders.amount) amount from orders,sales where orders.salesID=sales.salesID group by sales.dept/ packet summary SQL3fork A1=A3.query@x (A2) / parallel computing 4=A3.conj ()

/ merge result 5=A4.groups (DEPT;sum (AMOUNT): AMOUNT)

/ second grouping summary

The code that implements the grouping here also allows for the sub-library to execute SQL in parallel.

Using the aggregator to realize the sub-library summary contains several typical examples to illustrate the use of the sub-database summary. The operation of the cross-database data table is a more detailed explanation of the statistical query after the sub-database, as well as the key points and difficulties of the statistical query after video sub-database. The aggregator is also easily embedded in Java applications, and there are ways to use and get it how Java invokes the SPL script. For information about the installation and use of the aggregator, obtaining a free license, and related technical materials, you can see how the aggregator is used.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report