jade_22 0 Newbie Poster

Hello, I have a wordpress blog that I'm just testing around.
I've chosen "friendly" urls which look like this:
http://www.self-made.us/2008/06/organization-of-material/
where the link is in this format : /[year]/[month]/[title of post]/

The "normal" link would look like this :
http://www.self-made.us/?p=4
where p equals the database primary key of which the table is indexed.

My question is how in the world do you query the database using the first link? Do they really find the row by searching on the text-based "title of post" field? If so, this seems like such a huge performance hit, over having direct access to the primary key in integer form, as shown in the second link. Also consider that some blogs have hundreds and hundreds of pages.

So how does the first link actually work?
Thanks!

P.S. If you notice www.digg.com also does this, and they must store litterally MILLIONS of pages,
so how can they access their data so quick, seemingly using a word-based search?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.