Skip to content

Commit 84c8299

Browse files
committed
Add FAQ about slow joins
1 parent 4ca6c90 commit 84c8299

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/source/faq.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@ FAQ
44

55
This page contains a list of some frequently asked questions.
66

7+
Performance
8+
===========
9+
10+
Querying across relational fields like :class:`~django.db.models.ForeignKey` and :class:`~django.db.models.ManyToManyField` is really slow. Is there a way to improve the speed of these joins?
11+
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
12+
13+
Not really. Joins use MongoDB's :doc:`$lookup
14+
<manual:reference/operator/aggregation/lookup>` operator, which doesn't perform
15+
well with large tables.
16+
17+
The best practice for modeling relational data in MongoDB is to instead use
18+
:doc:`embedded models <topics/embedded-models>`.
19+
720
Troubleshooting
821
===============
922

0 commit comments

Comments
 (0)