I\'m currently trying to find the best way (in term of usability and performance) when dealing with a situation like fetching records tagged with a specific tag, or category
The first one is better, but can the slugs possibly be changed? In that case you'd need to have a redirect table (e.g. "some-article-about-dogs" is now "article-about-dogs-and-cats").
With the first URL style and your current db design, you can do this:
select ...
from posts p
join posts_to_tags pt on pt.post_id = p.post_id
join tags t on t.id = pt.tag_id
where t.slug = [url slug value];
As long as tags.slug is indexed, this should be very efficient, hardly any different from
select ...
from posts p
join posts_to_tags pt on pt.post_id = p.post_id
where pt.tag_id = [url tag ID];