Skip to content
Discussion options

You must be logged in to vote

Hi, one piece of information that I'm missing is why you need the parent id - can you explain that?

A couple of query-related comments:

  • For navigation property - based relationships it's more performant to query the class that has the navigation property, than the relationship. So instead of SELECT ECInstanceID, SourceECInstanceID FROM bis.ElementOwnsChildElements, it's better to do SELECT ECInstanceId, Parent.Id FROM bis.Element.

  • You can select element aspects' information in the same query, too:

    SELECT e.ECInstanceId, e.Parent.Id, a.Identifier
    FROM bis.Element e
    LEFT JOIN bis.ExternalSourceAspect a ON a.Element.Id = e.ECInstanceId

Replies: 2 comments 9 replies

Comment options

GhisBntly
May 14, 2025
Collaborator Author

You must be logged in to vote
2 replies
@grigasp
Comment options

grigasp May 15, 2025
Collaborator

@GhisBntly
Comment options

GhisBntly May 15, 2025
Collaborator Author

Comment options

You must be logged in to vote
7 replies
@GhisBntly
Comment options

GhisBntly May 15, 2025
Collaborator Author

@GhisBntly
Comment options

GhisBntly May 15, 2025
Collaborator Author

@grigasp
Comment options

grigasp May 15, 2025
Collaborator

@diegoalexdiaz
Comment options

@GhisBntly
Comment options

GhisBntly May 15, 2025
Collaborator Author

Answer selected by GhisBntly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants