I just use WordPress few times ago. and i realized WordPress is using keyword to identify the record in database.
Heres the example:
URL: example.com/site/just-do-it
~> just-do-it is a keyword , and the field hosted this keyword is indexed field.
so , this way can be slower or take more resource of mysql when compare with using regular number ID (123,456…)
many tks.
i have one more issue with this question.
that’s about using tag.
with tag (just like stackoverflow) should i use /id/tag/ or /tag/ only?
use tag as identification is easy for user to search.
tag is a shorter than topic title, but one topic will have many tags.
so with many of tag records. is it ok when use tag title instead of tag ID?
Yes, it will in general be slower than using a numeric PK. INT – the most commonly used datatype for PK – is 4B long, and so the index created over this columns uses only 4B per row and only needs to compare 4B to find the record. The index created on wordpress tabl you mention is probably much longer (possibly over 100B), and thus needs both more memory (on disk as well as RAM) and processing power.
The question is: does it matter? The answer is not straightforward. On a small site, with limited number of visitors it most likely doesn’t matter at all. However this can be a limiting factor, when amount of rows in table as well as queries to that table increase.