3 ms·
I don't think it's likely that you ever really need query hints. Even if updating analyses, creating indices, changing the query, etc. fails, you can always ei
by devit 6y ago
I don't think it's likely that you ever really need query hints.
Even if updating analyses, creating indices, changing the query, etc. fails, you can always either use CTEs or temporary tables, or use a stored procedure that manually iterates over results to implement whatever strategy is desired.
It might be more time consuming than having query hints, although this is compensated by the fact that almost always queries just work after creating appropriate indices.
- jdm2212 6y ago> It might be more time consuming than having query hints The queries in question can't be allowed to get any slower than they already are. They bottleneck certain critical uses.
- paulryanrogers 6y agoDo query hints lock in the implementation though? I imagine that DB upgrades could have different performance characteristics both with and without hints.
- necovek 6y agoI believe the GP post was referring to restructuring your query so you make Postgres hit better indices (eg. when you know the distribution of data but can't easily apply a partial index). A common way to do that in Postgres is to use subselects for a criteria, and the join in the outer query. Coming up with such queries is "more time consuming". And yes, this approach is fragile even in Postgres (version or data changes might affect the performance, or you might be stuck with a worse query when query planner becomes smarter), so I imagine query hints in Oracle have the same problem.
- devit 6y agoI meant time consuming in developer time, sorry.