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
Post a Comment