python - django mysql force usage of index -


i'm using django orm , mysql. reason mysql using wrong index. want manually override index used. saw django team decided cross platform reason prevent usage of with_hints extension force index. have kind if solution \ proposal how mysql use correct index through django?

thanks

django supports raw sql queries fit needs, see documentation article performing raw sql queries.

when model query apis don’t go far enough, can fall writing raw sql. django gives 2 ways of performing raw sql queries: can use manager.raw() perform raw queries , return model instances, or can avoid model layer entirely , execute custom sql directly.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -