for mysql and inoDB engine and tables that most use for read(not much create and edit compare with read queries)
tables are for blogging platform(user can create blog for themselves) and here are my two option for table schema:
for example for table posts:
1: posts(id, blog_id, title, content) => id is the only primary key auto increment
2: posts(id, blog_id, title, content) => composite primary key is (id, blog_id) and I use trigger before create query to increment id column
and in most of my queries there is two type of where:
1: for retrieve a single post:
where id=5for solution one
where id=2 and blog_id=3for solution two
2: for retrieve multi posts of single blog
where blog_id=3for solution one
where blog_id=3for solution two
question: which one is better for performance?
ps. if my question is not clear tell then I explain more.