|
|
|
|
|
by lxn
2598 days ago
|
|
1) Indexing text vs indexing integer it's very different when it comes to memory/space required by the database. 2) There is already an index on ids assuming they are used as primary keys, why adding another index (on text)? 3) To support changing slugs (titles) you will have to keep all the old slugs as well (to redirect them to their new versions). With ids you don't have to do this - ids have no reason to change. In the end you might not feel the difference in execution time, but hardware requirements for servers... I agree that they are annoying, but when the only reason against them is to improve URLs aesthetics (assuming they don't pose a security/information disclosure risk) - the trade of performance, hardware requirements and extra code needed is not worth it IMHO. |
|
Which basically means a join in the database. While not terribly expensive, its a lot more involved than a simple column value check.