Get the App
SLTechnology News&Howtos  ›  Database  › 

Questions about like query of TiDB SQL Test

Shulou Source: shulou.com Published: 2022-06-01 21:55:46 09月30日 Update

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)) ->

Tags: Time complexity business new projects problems queries tests systems results different that is letters loose obvious consistent commonplace two Internet lunch Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL OPPO Reno NVidia Shulou Information Docker