-
公开(公告)号:US20180039671A1
公开(公告)日:2018-02-08
申请号:US15783483
申请日:2017-10-13
Applicant: HUAWEI TECHNOLOGIES CO., LTD.
Inventor: Yidong YANG , Wenqi ZHU , Qing ZHANG , Li YAO , Zhongchu ZHU
IPC: G06F17/30
CPC classification number: G06F16/2456 , G06F16/24549 , G06F16/256 , G06F16/278
Abstract: The present invention discloses a method and an apparatus for querying data in cross-shard databases. The method includes: receiving a query request; querying statistics information of respective shard databases in which two tables used in an association operation are located; sending, according to the statistics information and the query condition, a driving table query request to a shard database in which a driving table is located, and receiving a first query result set returned by the shard database in which the driving table is located; deduplicating association field values in the first query result set, and sending a result set delivery request and deduplicated association field values to a shard database in which the non-driving table is located; and sending a non-driving table query request to the shard database; and receiving a second query result set returned by the shard database. Efficiency of querying data in cross-shard databases is improved.
-
公开(公告)号:US20200019552A1
公开(公告)日:2020-01-16
申请号:US16579209
申请日:2019-09-23
Applicant: HUAWEI TECHNOLOGIES CO., LTD.
Inventor: Yong DENG , Chenghua LIU , Yidong YANG , Wenqi ZHU
IPC: G06F16/2453 , G06F16/2455 , G06F11/34
Abstract: A query optimization method performed by a data access node includes: receiving a query request that is used to query tenant data; searching for a cached optimal query plan for the query request; if the optimal query plan is found, using the optimal query plan as a target query plan; or if no optimal query plan is found, generating a target query plan corresponding to the query request; and submitting the target query plan to a database, where the target query plan is used by the database to query the tenant data. Logical access (query request) is converted into a query plan (physical data access) by the data access node rather than a database node. In addition, the optimal query plan is used for query, so as to reduce a query cost as much as possible, and improve query performance.
-