Skip to main content
2 of 3
rephrased
ashleedawg
  • 1.2k
  • 8
  • 20

"Magic Column: [User Link]" produces "Out of Resources" error on simple SEDE queries

I ran into a "rare error" on SE Data Explorer and I've saved 3 near-identical queries on SEDE to demonstrate this potential [minor] database problem.

Unfinished so pretty simple so far, this is what the query's supposed to do:

  • List ID and CreationDate of all questions asked since 𝓷 days before "today", where 𝓷 is specified by in the parameter box below the query. (For example, 7 returns questions asked in the last 7 days, which is what the links below will default to.)

  • If the question has been answered, list the CreationDate of the first answer, and the difference (in minutes) between the ask and the answer. (If the question hasn't been answered, leave these values NULL.)


  • Example #1: (a "control"; no magic column) runs fine for any timeframe including "all of history".

  • Example #2: is the same as #1 except for an added magic [Post Link] field added. It runs fine for 7 days back. Change the parameter to 10 or more to repro the error:

    The query processor ran out of internal resources and could not produce a query plan. This is a rare event and only expected for extremely complex queries or queries that reference a very large number of tables or partitions. Please simplify the query. If you believe you have received this message in error, contact Customer Support Services for more information.

  • Example #3: is the same as #1 except I added [My Post Link]: provides the same functionality that '[Post Link]" does, using a 3rd join to the same table, which was unnecessary but for the sake of adding complexity. It works without a problem.

I've had the same error on other queries using Magic Columns. The only other mention of this error I could find is: "Out-of-resources when trying to run a popular DataExplorer query" - including a workaround from @rene to substitute for [User Link] - showing that this is a known issue (since at least 2016) and hasn't been addressed.


I was directed to report any SEDE issues here although in's not a huge issue since I can easily re-create the Magic Column's functionality (in less time than it took to describe the problem):

'site://posts/' + cast(q.id AS nvarchar)+'|'+q.title  as [My Post Link] 

...where q is an alias for the Posts table instance that the questions are being drawn from.

ashleedawg
  • 1.2k
  • 8
  • 20