简体   繁体   中英

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

I have MYISAM table and i wrote a FULL-TEXT SQL query. 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

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:

I am using mysqli_query($this->dbconnection, $this->query) in query

Update 2:

PHP Code http://codepad.org/qufZBC16

Note :

I am not running any other sql query on this page.

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

I'm not sure what charset your data Is stored in

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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