如何提高查询加入字符串的性能?

时间:2022-03-14 05:52:51

I have two table

我有两张桌子

  1. order Table
  2. 订单表
  3. marketplace_payment Table
  4. marketplace_payment表

An order table contain a field marketplace_ref_no Having Type varchar(24) Collation utf_general_ci

订单表包含字段marketplace_ref_no具有类型varchar(24)Collat​​ion utf_general_ci

A marketplace_payment Table contains this field with same name marketplace_ref_no Having Type varchar(24) Collation utf_general_ci

marketplace_payment表包含具有相同名称的此字段marketplace_ref_no具有类型varchar(24)Collat​​ion utf_general_ci

However When I am trying to join both the tables, It is taking 2 minutes 48 second to execute. What are the measures should i take?

但是,当我尝试加入两个表时,执行时需要2分48秒。我应该采取什么措施?

1 个解决方案

#1


0  

You might consider indexing the columns. This will have the effect of reducing the number of rows that must be searched. Read more here

您可以考虑索引列。这将减少必须搜索的行数。在这里阅读更多

https://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html

https://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html

#1


0  

You might consider indexing the columns. This will have the effect of reducing the number of rows that must be searched. Read more here

您可以考虑索引列。这将减少必须搜索的行数。在这里阅读更多

https://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html

https://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html