Q&A for user experience researchers and experts
select p.id , p.creationdate, p.viewcount into #taggedPosts from posts p inner join posttags pt on pt.postid = p.id inner join tags t on t.id = pt.tagid where t.tagname = '##tag##' create clustered index #ix_taggedposts_id on #taggedposts(id) create index #ix_taggedposts_creationdate on #taggedposts(creationdate) create index #ix_taggedposts_viewcount on #taggedposts(viewcount) select top 100 p.id [Post Link] from posts p inner join #taggedPosts tp on tp.id = p.id where body like '%##term1##%' or body like '%##term2##%' or body like '%##term3##%' order by tp.viewcount desc