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

Questions about like query of TiDB SQL Test

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Recently, there is a very core new project on hand, and part of the business is inherited from the old system, which is based on Oracle. Although the usual concurrency is not high compared with Internet business, the complexity of SQL is very high, and it is common to associate 5 or 6 tables. In the context of the group going to'O', the database option of the new project mainly considers NewSQL--TiDB.

Due to the tight launch time and complex business logic of the new project, the developer colleagues said that the complexity of the new project SQL will not be lower than that of the old system. The concern now is the performance of TiDB when implementing complex SQL. Recently, a phenomenon was found during testing (TiDB is version 2.1):

MySQL [db1] > select

-> DISTINCT v.vehicle_no vehicleNo

-> '2019-05-31 108 Fraser 59 as expireDate

-> b.batch_name as batchName

-> r.is_distribute isDistribute

-> date_format (r.date_created, 'yyyy-MM-dd') dateCreated

-> r.tmr_id tmrId

-> t.customer_id customerId

-> r.task_group_id taskGroupId

-> 'test' as codeDesc

-> 'test' as robotName

-> c.campaign_name campaignName

-> v.policy_end_date policyEndDate

-> 'test' as listRank

-> s.special_dial_org_name specialName

-> 'test' as secondOrg

-> from t_pub_task t

-> t_pub_robot_communicate r

-> t_pub_campaign c

-> t_pub_batch b left join

-> t_aas_dialorg_custcount_source s on b.tcims_batch_id = s.batch_id

-> t_pc_vehicle v

-> where r.task_group_id = t.task_group_id

-> and t.vehicle_id is not null

-> and t.vehicle_id = v.nets_vehicle_id

-> and t.batch_id = b.batch_id

-> and t.campaign_id = c.campaign_id

-> and t.team_id = '1000002832'

-> and v.nets_cust_id = t.customer_id

-> and r.list_type = 7

-> and c.biz_model ='1'

-> and r.tmr_id IS NULL

-> AND r.is_distribute ='N'

-> AND (r.date_created > = date_format ('20090531092304),'% Y-%m-%d 00lv 00')

-> AND (r.date_created

< DATE_ADD(date_format('20190531092304', '%Y-%m-%d 00:00:00'), interval 1 day)) ->

< DATE_ADD(date_format('20190531092304', '%Y-%m-%d 00:00:00'), interval 1 day)) ->

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

Database

Wechat

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

12
Report