You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The database for our project is actually AWS's DocumentDB service. I will say off the bat that I do understand that it's not technically MongoDB, and there are some feature differences - however, we recently upgraded our Symfony project from v 1.1 to v2.0 (technically we upgraded doctrine/mongo-odm-bundle from ^3.5 to ^4.3) and things were working much better before the upgrade.
We are experiencing very long query times on some particular queries, that are definitely covered by indexes. Performance logging in AWS indicates that Document DB is choosing to not use any indexes for the query, and so in this case the AWS documentation recommends using index hints on the queries to force DocumentDB to use the index.
Previous behavior
Before we upgraded, the hints were being added to the find query
Current behavior
Index hints are not passing through to the query.
How to reproduce
I'm actually not totally sure how to describe how to reproduce the behavior, but I've identified where in the code this is going wrong.
BC Break Report
Summary
The database for our project is actually AWS's DocumentDB service. I will say off the bat that I do understand that it's not technically MongoDB, and there are some feature differences - however, we recently upgraded our Symfony project from v 1.1 to v2.0 (technically we upgraded doctrine/mongo-odm-bundle from ^3.5 to ^4.3) and things were working much better before the upgrade.
We are experiencing very long query times on some particular queries, that are definitely covered by indexes. Performance logging in AWS indicates that Document DB is choosing to not use any indexes for the query, and so in this case the AWS documentation recommends using index hints on the queries to force DocumentDB to use the index.
Previous behavior
Before we upgraded, the hints were being added to the find query
Current behavior
Index hints are not passing through to the query.
How to reproduce
I'm actually not totally sure how to describe how to reproduce the behavior, but I've identified where in the code this is going wrong.
First, we use DoctrineQueryBuilder->hint() method to create a query, and add an index hint.
https://github.com/doctrine/mongodb-odm/blob/2.2.x/lib/Doctrine/ODM/MongoDB/Query/Builder.php#L782
In that MongoDB/Query/Query object that is created, the hint is definitely present, but when it comes time to pass the data to the collection->find(), the hint is not added to the $queryOptions
https://github.com/doctrine/mongodb-odm/blob/2.2.x/lib/Doctrine/ODM/MongoDB/Query/Query.php#L427
For some reason the hint IS being added to count queries later in that same switch, so I'm not sure if it's being intentionally left off of the finds:
https://github.com/doctrine/mongodb-odm/blob/2.2.x/lib/Doctrine/ODM/MongoDB/Query/Query.php#L508
In my test server, if I manually add 'hint' to line#427 above, my page load time goes from around 14803ms to 505ms.
The text was updated successfully, but these errors were encountered: