Best DB (MySQL) structure: Articles which contain favored tags

前端 未结 2 1722
再見小時候
再見小時候 2021-01-01 05:59

I\'ve built a news site: - The articles are shown on the front page ordered by date. The newest one first. - The news are in the table \"news\" with the fields \"id\", \"t

2条回答
  •  被撕碎了的回忆
    2021-01-01 06:02

    The query's performance (whether in your sub-select approach, or Frank Farmer's more elegant join-based one) will chiefly depend on indices. Just remember that MySQL uses just one index per table, and the proper set of indices (depending on the query you want to optimize) invariably becomes pretty obvious...

提交回复
热议问题