|
Posted by Tom on 01/30/07 20:40
On Sat, 27 Jan 2007 12:01:02 +0100, Szymon Bobek wrote...
>
>Hi!
>
>I have databese with a few tables named like that: films_triller,
>films_horror, films_action etc.
>I decided to create many tables instead of creting just one big table
>containing all sort of films. Is it a good idea? (I think, that it boost
>search time much - am I right?)
>Now - to find a film (when only title is known) I have to search in all
>that tables. But I have a problem with that.. How to do that? SELECT * FROM
>REGEXP 'film_*' WHERE title='the film' does not work. The same is when I
>want to list all tables (to see what groups of films I have) - if I try do
>join SHOW TABLES with REGEXP I get an syntax error too.
>
>Where is the mistake and how to correct it?
>
>Thanks in advance
>Szymon Bobek
>
>
Based on your example it would seem like a lot more effort would be needed to do
a simple look up. Maybe try consolidating the films_* tables into one and create
a "film_types" table with a simple index that can carry over to an extra column
in your global films table.
That way if you needed to narrow your search you have the field defined, and
saves the headache of locating multiple tables and searching them individually.
Tom
--
Newsguy.com Basic $39.95 / year
http://www.newsguy.com/overview.htm
Navigation:
[Reply to this message]
|