简体   繁体   English

如何提高基于字符串的查询联接的性能?

[英]How to improve performance of the query joining on string basis?

I have two table 我有两个桌子

  1. order Table order
  2. marketplace_payment Table marketplace_payment

An order table contain a field marketplace_ref_no Having Type varchar(24) Collation utf_general_ci 一个order表包含一个字段marketplace_ref_no有类型varchar(24)整理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)归类utf_general_ci

However When I am trying to join both the tables, It is taking 2 minutes 48 second to execute. 但是,当我尝试同时连接两个表时,执行此操作需要2分48秒。 What are the measures should i take? 我应该采取什么措施?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM