Skip to main content
replaced http://data.stackexchange.com/ with https://data.stackexchange.com/
Source Link

There are several options. One is to limit your search scope to a single tag and use a TOP with a reasonable number.

Here is a queryquery where I applied that technique.

select top 100 
       p.id as [Post Link]
from posts p
inner join posttags pt on pt.postid = p.id
inner join tags t on t.id = pt.tagid
where t.tagname = ##tagname:string?javascript##
and body like '%##body##%' collate sql_latin1_general_cp1_ci_ai

Other options are to limit on the creationdate (use a BETWEEN statement).

Don't forget that SEDE has an option to include the execution plan (the query needs to run or alternatively use the set showplan_all on statement)

execution plan

You can apply SQL Server statement tuning techniques to improve the performance of the query.

There is a known issue with the Magic Link Columns (like [Post Link]) that cause an out of resources error even for small resultsets. I have answered a similar question about that topic: Out-of-resources when trying to run a popular DataExplorer query with both an analysis of the root cause and offer a work around.

There are several options. One is to limit your search scope to a single tag and use a TOP with a reasonable number.

Here is a query where I applied that technique.

select top 100 
       p.id as [Post Link]
from posts p
inner join posttags pt on pt.postid = p.id
inner join tags t on t.id = pt.tagid
where t.tagname = ##tagname:string?javascript##
and body like '%##body##%' collate sql_latin1_general_cp1_ci_ai

Other options are to limit on the creationdate (use a BETWEEN statement).

Don't forget that SEDE has an option to include the execution plan (the query needs to run or alternatively use the set showplan_all on statement)

execution plan

You can apply SQL Server statement tuning techniques to improve the performance of the query.

There is a known issue with the Magic Link Columns (like [Post Link]) that cause an out of resources error even for small resultsets. I have answered a similar question about that topic: Out-of-resources when trying to run a popular DataExplorer query with both an analysis of the root cause and offer a work around.

There are several options. One is to limit your search scope to a single tag and use a TOP with a reasonable number.

Here is a query where I applied that technique.

select top 100 
       p.id as [Post Link]
from posts p
inner join posttags pt on pt.postid = p.id
inner join tags t on t.id = pt.tagid
where t.tagname = ##tagname:string?javascript##
and body like '%##body##%' collate sql_latin1_general_cp1_ci_ai

Other options are to limit on the creationdate (use a BETWEEN statement).

Don't forget that SEDE has an option to include the execution plan (the query needs to run or alternatively use the set showplan_all on statement)

execution plan

You can apply SQL Server statement tuning techniques to improve the performance of the query.

There is a known issue with the Magic Link Columns (like [Post Link]) that cause an out of resources error even for small resultsets. I have answered a similar question about that topic: Out-of-resources when trying to run a popular DataExplorer query with both an analysis of the root cause and offer a work around.

added 386 characters in body
Source Link
rene
  • 42.3k
  • 55
  • 610
  • 777

There are several options. One is to limit your search scope to a single tag and use a TOP with a reasonable number.

Here is a query where I applied that technique.

select top 100 
       p.id as [Post Link]
from posts p
inner join posttags pt on pt.postid = p.id
inner join tags t on t.id = pt.tagid
where t.tagname = ##tagname:string?javascript##
and body like '%##body##%' collate sql_latin1_general_cp1_ci_ai

Other options are to limit on the creationdatecreationdate (use a BETWEEN statement).

Don't forget that SEDE has an option to include the execution plan (the query needs to run or alternatively use the set showplan_all on statement)

execution planexecution plan

You can apply SQL Server statement tuning techniques to improve the performance of the query.

There is a known issue with the Magic Link Columns (like [Post Link]) that cause an out of resources error even for small resultsets. I have answered a similar question about that topic: Out-of-resources when trying to run a popular DataExplorer query with both an analysis of the root cause and offer a work around.

There are several options. One is to limit your search scope to a single tag and use a TOP with a reasonable number.

Here is a query where I applied that technique.

select top 100 
       p.id as [Post Link]
from posts p
inner join posttags pt on pt.postid = p.id
inner join tags t on t.id = pt.tagid
where t.tagname = ##tagname:string?javascript##
and body like '%##body##%' collate sql_latin1_general_cp1_ci_ai

Other options are to limit on the creationdate (use a BETWEEN statement.

Don't forget that SEDE has an option to include the execution plan (the query needs to run or alternatively use the set showplan_all on statement)

execution plan

You can apply SQL Server statement tuning techniques to improve the performance of the query.

There are several options. One is to limit your search scope to a single tag and use a TOP with a reasonable number.

Here is a query where I applied that technique.

select top 100 
       p.id as [Post Link]
from posts p
inner join posttags pt on pt.postid = p.id
inner join tags t on t.id = pt.tagid
where t.tagname = ##tagname:string?javascript##
and body like '%##body##%' collate sql_latin1_general_cp1_ci_ai

Other options are to limit on the creationdate (use a BETWEEN statement).

Don't forget that SEDE has an option to include the execution plan (the query needs to run or alternatively use the set showplan_all on statement)

execution plan

You can apply SQL Server statement tuning techniques to improve the performance of the query.

There is a known issue with the Magic Link Columns (like [Post Link]) that cause an out of resources error even for small resultsets. I have answered a similar question about that topic: Out-of-resources when trying to run a popular DataExplorer query with both an analysis of the root cause and offer a work around.

Source Link
rene
  • 42.3k
  • 55
  • 610
  • 777

There are several options. One is to limit your search scope to a single tag and use a TOP with a reasonable number.

Here is a query where I applied that technique.

select top 100 
       p.id as [Post Link]
from posts p
inner join posttags pt on pt.postid = p.id
inner join tags t on t.id = pt.tagid
where t.tagname = ##tagname:string?javascript##
and body like '%##body##%' collate sql_latin1_general_cp1_ci_ai

Other options are to limit on the creationdate (use a BETWEEN statement.

Don't forget that SEDE has an option to include the execution plan (the query needs to run or alternatively use the set showplan_all on statement)

execution plan

You can apply SQL Server statement tuning techniques to improve the performance of the query.