Does anyone have any SQL optimization tips they can share?
For example, I learned recently that the cost of SDO_GEOMETRY functions doesn’t usually get included in the explain plan cost (at least not functions in the SELECT clause). I had a query that used a bunch of nested SDO_GEOMETRY functions in the SELECT clause that was slow, yet the explain plan cost was surprisingly small. It took me a while to realize that Oracle doesn’t usually include the cost of functions in the explain plan cost.
Related, although not specific to spatial queries: https://stackoverflow.com/questions/66671812/are-functions-considered-in-execution-plan
Any other optimization tips come to mind?