dm icon indicating copy to clipboard operation
dm copied to clipboard

Avoid downtream repeating parse SQL

Open lance6716 opened this issue 4 years ago • 4 comments

Feature Request

Is your feature request related to a problem? Please describe:

seems DM will generate a lot of similar SQL, for example, for same table all INSERT should be the same. So using one PREPARE and many EXECUTE will reduce downstream SQL parsing time.

Another way is that try to attach many rows in one statement, for example, INSERT ... VALUES ((), (), ()) or DELETE ... WHERE .. OR .. OR ..

Describe the feature you'd like:

see above

Describe alternatives you've considered:

Teachability, Documentation, Adoption, Migration Strategy:

lance6716 avatar Jun 02 '21 09:06 lance6716

It seems we need a prepared statement cache?

hidehalo avatar Jun 10 '21 04:06 hidehalo

It seems we need a prepared statement cache?

TiDB will handle the cache if we send PREPARE SQL

lance6716 avatar Jun 10 '21 05:06 lance6716

It seems we need a prepared statement cache?

TiDB will handle the cache if we send PREPARE SQL

Ok, I get it:

a) use prepare replace to plaintext query. b) merge batch insert/delete of operations into bulk operation.

hidehalo avatar Jun 10 '21 06:06 hidehalo

TiDB has spent 9% CPU on parse. And SQL digest generating (3%) will be quicker

lance6716 avatar Jul 08 '21 15:07 lance6716