-
|
I am trying to optimize the way I am querying Elements data by checking whether the tables involved are indexed by the key property I am using to JOIN them, but copilot-suggested instructions to determine how tables are indexed do not seem to work (using the imodelconsole):
My current query: Note: I'm aware it doesn't scale, but for the moment I really need the data for all Elements of the iModel. Restricting the query(-ies) with WHERE clauses is another lead I can pursue but this would add several difficulties in our code logic. Thanks for advising, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Beta Was this translation helpful? Give feedback.
-
|
You can use PRAGMA ### explain_query But just looking at your query I can see it's just a SCAN over bis.Element generally the largest table. What do you want to accomplish with the query? I see you want source aspect for geom3d but I am not sure why you have bis.Element. Do you intent to read all element of all type but grab additional data for geometric elements? SELECT g.ECInstanceId, g.BBoxLow, g.BBoxHigh, g.Parent.Id, g.FederationGuid, a.Identifier
FROM bis.GeometricElement3d g
JOIN bis.ExternalSourceAspect a ON a.Element.Id = e.ECInstanceId |
Beta Was this translation helpful? Give feedback.


You can use PRAGMA ### explain_query
But just looking at your query I can see it's just a SCAN over bis.Element generally the largest table. What do you want to accomplish with the query? I see you want source aspect for geom3d but I am not sure why you have bis.Element. Do you intent to read all element of all type but grab additional data for geometric elements?