The USE INDEX (index_list) hint tells MySQL to use only one of the named indexes to find rows in the table.
(self, *index_names: str)
| 1003 | return self |
| 1004 | |
| 1005 | def use_index(self, *index_names: str) -> QuerySet[MODEL]: |
| 1006 | """ |
| 1007 | The USE INDEX (index_list) hint tells MySQL to use only one of the named indexes to find rows in the table. |
| 1008 | """ |
| 1009 | if self.capabilities.support_index_hint: |
| 1010 | queryset = self._clone() |
| 1011 | for index_name in index_names: |
| 1012 | queryset._use_indexes.add(index_name) |
| 1013 | return queryset |
| 1014 | return self |
| 1015 | |
| 1016 | def prefetch_related(self, *args: str | Prefetch) -> QuerySet[MODEL]: |
| 1017 | """ |