3 ms·
What database are you using? Oracle [1] and MySQL [2] for example let you embed hints in the query in order to change the execution plan. I think that PostreSQL
by mrighele 8y ago
What database are you using? Oracle [1] and MySQL [2] for example let you embed hints in the query in order to change the execution plan. I think that PostreSQL doesn't have such a feature though (at least it did not a few years ago).
[1] https://docs.oracle.com/cd/B19306_01/server.102/b14211/hintsref.htm#i8327 https://docs.oracle.com/cd/B19306_01/server.102/b14211/hints...
[2] https://dev.mysql.com/doc/refman/8.0/en/optimizer-hints.html https://dev.mysql.com/doc/refman/8.0/en/optimizer-hints.html
- iracic 8y agoYou can also record and save plan you are happy with. So, no need to fix hints in code. It is more flexible and may be practical when you upgrade version or environment changes.
- lixtra 8y agoCan you do that in MySQL? For Oracle you AFIAK need special permission to save a plan. In larger corporations this means you have call the db admin which makes total sense for OLTP (and is a good feature of SQL dbs). If you’re exploring something in OLAP this is not so great.