|
Subject:
|
Provide Searching from more than 60 tables
|
|
Posted By:
|
snowbydave1
|
Post Date:
|
6/30/2008 5:49:12 AM
|
Hi Friends,
I want to provide searching of a text from more than 60 tables. If I established join with query then it will became very large query and I scare that it will not run on live server.
e.g. say I want to search "snowby" from database table then how shall I ? Because there is more than 60 tables in a database.
Is anybody have concreate idea about this...?
Thanks in advance
Snowby Dave
|
|
Reply By:
|
Old Pedant
|
Reply Date:
|
6/30/2008 2:28:51 PM
|
JOIN wouldn't be right anyway.
You mean a UNION. And you COULD do that, but you are right, it would probably perform very badly.
I hate to say it, but likely the best way is to simply loop through all the tables, one at a time. Especially if you don't know which field (or fields) to search in each table until you query its schema.
But you *COULD* do a set of unions (e.g., 5 tables per union, so you only make 12 separate queries??), especially if some of the tables have similar structures. I'm not sure that would buy you tons of performance, but surely would get you some.
|