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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.