Version.object_id lookups too slow
See original GitHub issueIn cases where the pk
field of a given model is not an int, the object_id_int
is not being used. If a lot of rows exists for this model, it makes the lookups very very slow.
These look ups can be made considerably faster by adding a db_index=True
attribute to the text field.
It seems South
does allow creating a schemamigration for this and it runs with sqlite and postgresql. Also, Django adds a type specific index (if db supports it).
Is there any reason why this can’t be added?
Issue Analytics
- State:
- Created 9 years ago
- Comments:15 (7 by maintainers)
Top Results From Across the Web
Query is slow when $lookup - Working with Data - MongoDB
Query is slow when $lookup ... If, as in the code above, attach the comments documents to the joined “address” document, then with...
Read more >MongoDB $lookup using "$expr" is slow compared to simple ...
Basically this problem make the $lookup impossibile to be used for scenario where the lookup must use 2 fields to compute the join....
Read more >$lookup on ObjectId's in an array - mongodb - Stack Overflow
2017 update. $lookup can now directly use an array as the local field. $unwind is no longer needed. Old answer. The $lookup aggregation ......
Read more >Incredibly slow query performance with $lookup and “sub ...
This query is getting incredibly slow when the collections are growing in size. With 1000 tasks and 20 customers it already takes about...
Read more >Mongoose v6.8.0: API docs
This function is similar to isValidObjectId() , but considerably more strict, because isValidObjectId() will return true for any value that Mongoose can convert ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closed by 54288b055ad8a8dca75e18482f9d90e88805281b
Sorry for not coming through, we’re all talk and no action, thanks for the fix @etianen !