Skip to content

Query too long to execute or server is too busy #6357

Closed Answered by khanaffan
showgata-code asked this question in Q&A
Discussion options

You must be logged in to vote

By looking at the query it has a lot of unnecessary joins and string processes. I read the query as follows

  1. Get Classes of all the Aspects (unique + multi)
  2. Get all base classes of classes returned in step 1
  3. Geta all the properties of classes in step 2
  4. return className, classLabel, propertyName & propertyLabel.

If the above is correct then you can reduce the query to following. It is still a bit slower you might want to exclude BisCore.ExternalSourceAspect

SELECT  
	c.Name AS className,
	c.DisplayLabel AS classLabel,		
	p.Name AS Name,
	p.DisplayLabel AS AttributeDisplayLabel
FROM ECDbMeta.ECClassDef c
	JOIN ECDbMeta.ECPropertyDef p ON c.ECInstanceId = p.Class.Id
JOIN (
	SELECT DISTINCT cac

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by showgata-code
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants