question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Version.object_id lookups too slow

See original GitHub issue

In 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:closed
  • Created 9 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
etianencommented, Jun 1, 2016

Closed by 54288b055ad8a8dca75e18482f9d90e88805281b

0reactions
asfaltboycommented, Jun 1, 2016

Sorry for not coming through, we’re all talk and no action, thanks for the fix @etianen !

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found