How to write efficient Django ORM when the database you are working has no relationship defined(No foreign key )

13 views
Skip to first unread message

Yogesh Agarwal

unread,
Sep 6, 2019, 11:44:30 AM9/6/19
to Django users
Hiii guys, Currently I am working on a Database whose structure is very bad and I  want to write efficient Django ORM where two or more models are involved(similar to the joining of two or more table in SQL) and we can write the most efficient ORM to make it work fast?

Bhoopesh sisoudiya

unread,
Sep 6, 2019, 7:32:47 PM9/6/19
to django...@googlegroups.com
Hi yogesh,

First: you create index on columns which you want use in ORM.

Second: No need to create index on datetime field.

Third: Use join by ORM. No need to key-relationship in database.


Thanks
Bhoopesh sisoudiya

On Fri, Sep 6, 2019, 5:14 PM Yogesh Agarwal <yogesh...@gmail.com> wrote:
Hiii guys, Currently I am working on a Database whose structure is very bad and I  want to write efficient Django ORM where two or more models are involved(similar to the joining of two or more table in SQL) and we can write the most efficient ORM to make it work fast?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/690f9b8f-ceab-4b76-a906-99be88c9da9f%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages