Feedback
Did this article resolve your question/issue?

   

Article

Poor performance with Connect for ODBC MongoDB Driverr when using joins

Information

 
TitlePoor performance with Connect for ODBC MongoDB Driverr when using joins
URL Namepoor-performance-with-connect-for-odbc-mongodb-driverr-when-using-joins
Article Number000112474
EnvironmentProduct: Connect for ODBC MongoDB Drver
Version: 7.1
OS: All Supported
Database: MongoDB
Application: N/A
Question/Problem Description
When executing a statement with join syntax, the performance in some instances is slow.
Steps to Reproduce
Clarifying Information
Error Message
Defect Number56352
Enhancement Number
Cause
MongoDB doesn’t support JOINS across native collections, so the driver has to provide that functionality through its internal SQL engine. This will always be expensive, unless the tables being joined are stored within the same native table (i.e. if a parent-child relationship exists, performance is much better since this can be executed as a single query to the server). 

When using the [INNER] JOIN … ON … syntax, the optimizer assumes that the order of the tables matters or at least is determined by the user to give the best performance. With JOINs if the order of tables is specified in order from least number of rows to most number of rows, then a query with JOIN syntax will complete quickly.
 
Resolution
There are two options for resolving the slow performance:
  1. Optimize the query to get the best performance (order of tables should be smallest number of rows to highest number of rows) 
  2. Ensure that a parent-child relationship exists between the tables
Workaround
Replace the JOINs with commas
Notes
Last Modified Date11/23/2016 12:31 AM
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.