I need to create 2 tables:
Magazine (10 million rows with these columns: identifier, title, genres, print, price)
Author (180 million rows with these columns: id, name, journal_id)
. Each author can write in ONLY ONE, and each journal has more authors.
So, if I want to know all the authors of Motors Magazine, I have to use this query:
SELECT * FROM Author, Magazine WHERE ( Author.magazine_id = Magazine.id ) AND ( genres = 'Motors' )
The same applies to the Print & Price column.
To avoid these joins with million row tables, I thought of using these tables:
Magazine (10 million rows with this column: id, title, genres, print, price)
Author (180 million rows with this column: id, name, magazine_id, genres, print, price)
. and this request:
SELECT * FROM Author WHERE genres = 'Motors'
Is this a good approach?
I want it to work faster
I can use Postgresql or Mysql.
sql database mysql postgresql
xRobot
source share