I am trying to decide whether to create a global view table or 1 for each section. for example, Lets say I have products, categories and pages.
Do I have 3 tables e.g:
CREATE TABLE `tbl_products` (
`p_id` INT NOT NULL ,
`p_views` INT NOT NULL ,
INDEX ( `p_id` )
) ENGINE = MYISAM
CREATE TABLE `tbl_categories` (
`c_id` INT NOT NULL ,
`c_views` INT NOT NULL ,
INDEX ( `c_id` )
) ENGINE = MYISAM
CREATE TABLE `tbl_pages` (
`pg_id` INT NOT NULL ,
`pg_views` INT NOT NULL ,
INDEX ( `pg_id` )
) ENGINE = MYISAM
Or do I have 1 table storing all e.g.
CREATE TABLE `tbl_views` (
`view_id` INT NOT NULL ,
`view_type` VARCHAR( 10 ) NOT NULL ,
`view_views` INT NOT NULL ,
INDEX ( `view_id` )
) ENGINE = MYISAM
Where view_type is either products, categories or pages.
What would the advantages/disadvantages be of each solution?
Thanks in advance.