Best database (mysql) structure for this case:

Posted by robert on Stack Overflow See other posts from Stack Overflow or by robert
Published on 2010-04-08T13:21:10Z Indexed on 2010/04/08 13:23 UTC
Read the original article Hit count: 219

Filed under:
|
|

we have three types of data (tables):

  • Book (id,name,author...) ( about 3 million of rows)
  • Category (id,name) ( about 2000 rows)
  • Location (id,name) ( about 10000 rows)

A Book must have at least 1 type of Category (up to 3) AND a Book must have only one Location.

I need to correlate this data to get this query faster:

Select Books where Category = 'cat_id' AND Location = 'loc_id'

Select Books where match(name) against ('name of book') AND Location = 'loc_id'

Please I need some help. Thanks

© Stack Overflow or respective owner

Related posts about mysql

Related posts about fast