Page 1 of 1

Search Entire Database

Posted: Mon Jul 19, 2010 10:22 pm
by Skiddles2010
Let's say I have a database with 12 tables. Each of these tables contains a "name" column and a "url" column. I want the user to be able to search a word or phrase, and pull information from the tables based on the search.

Currently, the way I'm doing it is... the user submits his search phrase and then each MySQL table is individually searched for a total of 12 queries, each returning their own results. It works fine, but I'm worried that this method may be wasteful. Searching through every single record, every single time, could become a bandwidth issue later when each table has thousands of entries, correct?

Any thoughts on how to be more efficient?

Re: Search Entire Database

Posted: Tue Jul 20, 2010 4:26 am
by Alex-V
Create a new table that contains only 'name' and 'url' and use a GUID to link them with other tables. That way you can use just 2 queries for search