简体   繁体   English

SQL查询在MYSQL中花费的时间更少,在PHP应用程序中花费的时间更多

[英]SQL query takes less time in MYSQL, take more in PHP application

I have MYISAM table and i wrote a FULL-TEXT SQL query. 我有MYISAM表,我写了一个FULL-TEXT SQL查询。 When i execute this query, it takes < 0.53 seconds But when i execute this php+mysql application, it takes more than 1-2 minutes 当我执行此查询时,它花费<0.53秒,但是当我执行此php + mysql应用程序时,它需要超过1-2分钟

Query: 查询:

select concat(first_name, ' ', last_name) as `cand_full_name`, email 
from resumes WHERE MATCH (thesis_text) AGAINST ('-java -j2ee -oracle -mysql -software' IN BOOLEAN MODE) 

Update 1: 更新1:

I am using mysqli_query($this->dbconnection, $this->query) in query 我在查询中使用mysqli_query($this->dbconnection, $this->query)

Update 2: 更新2:

PHP Code http://codepad.org/qufZBC16 PHP代码http://codepad.org/qufZBC16

Note : 注意 :

I am not running any other sql query on this page. 我不在此页面上运行任何其他SQL查询。

Any Idea, why it's taking more time. 任何想法,为什么要花更多的时间。

Its very likely to be a charset issue. 它很可能是字符集问题。 Set the charset after connection to speed up query 连接后设置字符集以加快查询速度

http://php.net/manual/en/mysqli.set-charset.php#refsect1-mysqli.set-charset-description http://php.net/manual/en/mysqli.set-charset.php#refsect1-mysqli.set-charset-description

I'm not sure what charset your data Is stored in 我不确定您的数据存储在什么字符集

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

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