tristaZero commented on pull request #5215:
URL: https://github.com/apache/skywalking/pull/5215#issuecomment-667468282


   @dagmom @wu-sheng My impression is that MySQL will take some optimization 
for this SQL, so `1 = 1` does not matter.
   Here is a simple test,
   ``` sql
   mysql> explain select * from business where id = 1;
   
+----+-------------+----------+------------+-------+---------------+---------+---------+-------+------+----------+-------+
   | id | select_type | table    | partitions | type  | possible_keys | key     
| key_len | ref   | rows | filtered | Extra |
   
+----+-------------+----------+------------+-------+---------------+---------+---------+-------+------+----------+-------+
   |  1 | SIMPLE      | business | NULL       | const | PRIMARY       | PRIMARY 
| 4       | const |    1 |   100.00 | NULL  |
   
+----+-------------+----------+------------+-------+---------------+---------+---------+-------+------+----------+-------+
   1 row in set, 1 warning (0.02 sec)
   
   mysql> explain select * from business where 1=1 and id = 1;
   
+----+-------------+----------+------------+-------+---------------+---------+---------+-------+------+----------+-------+
   | id | select_type | table    | partitions | type  | possible_keys | key     
| key_len | ref   | rows | filtered | Extra |
   
+----+-------------+----------+------------+-------+---------------+---------+---------+-------+------+----------+-------+
   |  1 | SIMPLE      | business | NULL       | const | PRIMARY       | PRIMARY 
| 4       | const |    1 |   100.00 | NULL  |
   
+----+-------------+----------+------------+-------+---------------+---------+---------+-------+------+----------+-------+
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to