We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Index Hint in Query builder or PHQL

Hi, I use query builder and need to use Index hint to optimize my query. How can I add 'USE INDEX(key)' in Query Builder / or phql? if the feature hasn't been implemented in PHQL, Is there any workaround to use index hinting?



98.9k

Index hints aren't supported in PHQL, you can use a raw query if they're required: https://docs.phalcon.io/en/latest/reference/phql.html#using-raw-sql

Thanks @Phalcon. Sorry I missed reading that part.