I am working on a website and I want to make pretty urls. The urls are for certain extensions I am going to make. For example I want to have a url like this:
http://www.mydomain.com/extensions/tester
http://www.mydomain.com/extensions/worker
http://www.mydomain.com/extensions/this-is-a-really-long-ext-name
So the tester, worker, etc are all records in a database.
Now my main question is what the best way is to create the database and the queries for this. My first thought is just having the name part of the url as the primary index.
NOTE: all extensions will have a unique name.
The query in sql would then just be 'SELECT * FROM ? WHERE name = last-part-of-uri'
What are the downsides of doing this, I assume the indexes will get really long. Or is it better to use a primary index for the field, and then just a normal index for the name.
The primary index will serve no real purpose tho, maybe only in the backend.