If you work with PostgreSQL or any PostgreSQL-compatible database, you can install
pg_hint_plan to understand better the query planner choices. It is there by default in YugabyteDB to make it easier.
This extension is really good, but your first steps may be hard, and you may even think your hints are not taken into account. In this session, I explain everything you need to get your hints doing what you expect:
Thanks a lot to https://postgresconf.org for the recording. Next talks: https://postgresconf.org/conferences/PostgresWorld-Webinars-2022/tickets