Jump to content

Multiple table search with MySQL & PHP


DarkRanger

Recommended Posts

I'm assuming you are using JOIN and multiple WHERE,AND,OR or possible LIKE, MATCH mysql select statements.

 

To speed the queries up you can create indexes on any WHERE,AND,OR values

http://dev.mysql.com/doc/refman/5.6/en/create-index.html

 

You can view the slow query log to find your bottlenecks

http://dev.mysql.com/doc/refman/5.6/en/slow-query-log.html

 

It does matter the order in which you place these, try EXPLAIN, SHOW STATUS, and SHOW PROCESSLIST

http://dev.mysql.com/doc/refman/5.6/en/explain.html

http://dev.mysql.com/doc/refman/5.6/en/show-status.html

http://dev.mysql.com/doc/refman/5.6/en/show-processlist.html

 

Look into memcache to lessen the queries by caching.

http://memcached.org/

or

http://php.net/manual/en/book.memcache.php

 

If none of the above helps you (which they should), or to get quicker responses to queries, minimize results and only fetch data you need to.

To show the solutions can help:

http://dynaindex.com/search.php?s=%2Blisten+%2Bfree++%2Bmusic&filter=on&page=1

That's a multiple search sifting through a million plus posts for the correct content in multiple columns, pages will get cached and also is on one of my home computers (single core cpu and run it hard) on a residential line. The thumbs are live loading.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.