Search efficiently through multi-tables

admin

Administrator
Staff member
Hi folks:

Does anybody know how to search multiple tables of a database speedly and efficiently by some criteria ?

I want to search records across 5 tables(5 large tables). If I make a query with one select query, I wonder whether MySql will work to join so many tables at one time.

And is it a good way to divide the one query into 5 queries, each query accesses one table, with limited seaching scope by last query result?

That is to say, ie. firstly I do: "select A from table1 where c1", get results as A1,A2, ..., An.

and then I do the second query: "select A from table2 where c2 and (A=A1 or A=A2 or ... or A=An)". this time the result set will be shortened(or the same size). and then I do the next 3 queries the same way ...

any suggestions are welcome. thanx in advance.

idle
 
Back
Top