Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
  • 1.  ODBC Speed, Slow Queries

    Posted Tue June 08, 2010 01:01 AM

    Originally posted by: UDOPS


    Anyone have any experience with slow ODBC transactions? Do you find OPL's ODBC driver slow?
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: ODBC Speed, Slow Queries

    Posted Tue June 08, 2010 02:30 AM

    Originally posted by: SystemAdmin


    It reading or writing data?
    There are two settings available to control batch size:
    dbUpdateBatchSize
    dbReadBatchSize (since CPLEX Studio 12.2)

    Tschau, Frank
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: ODBC Speed, Slow Queries

    Posted Tue June 08, 2010 09:46 AM

    Originally posted by: UDOPS


    Thanks, I found dbUpdateBatchSize, but not dbReadBatchSize, in the documentation. Are the implementation and settings the same?
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: ODBC Speed, Slow Queries

    Posted Tue June 08, 2010 09:49 AM

    Originally posted by: UDOPS


    I just tried setting both, and received this error:

    Description Resource Path Location Type
    Execution of "main" failed: "C:\Documents and Settings\Harrodst\My Documents\Hypergraph Model\OPL MIP Model\Railway MIP 2010\A Main.mod", line 21: cannot set the 'dbReadBatchSize' property: 4096 A Main.mod Railway MIP 2010 15:6-122:2 C:\Documents and Settings\Harrodst\My Documents\Hypergraph Model\OPL MIP Model\Railway MIP 2010\A Main.mod OPL Problem Marker
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: ODBC Speed, Slow Queries

    Posted Tue June 08, 2010 10:09 AM

    Originally posted by: SystemAdmin


    dbReadBatchSize is not available with OPL 6.3.
    It is new in upcoming release, CPLEX Studio 12.2, which includes OPL.

    Tschau, Frank
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: ODBC Speed, Slow Queries

    Posted Tue June 08, 2010 10:20 AM

    Originally posted by: UDOPS


    Here is an example problem log. I track elapsed time at intervals by setting variables with the Date() methods.

    Note how the database queries take more time than solving the model. The data retrieved for formulating the problem is between 800 and 900 records. The solution returned to the database consists of 462 records (a tuple for each binary variable = 1).

    In the post processing block, if I comment out the database update, the time drops to a small value.

    Start of Main Program, 06/08/2010 13:50:05 885
    Set of problems queued in FileMaker: {1515}
    Time elapsed retrieving queue 2.234 seconds

    Problem this loop: 1515
    Time elapsed constructing query 0.016 seconds
    Composing model

    Pre-Process block.
    Time elapsed making query and generating model 542.703 seconds
    • Solving master model**************

    Time elapsed solving problem 600.234 seconds

    Post-processing executed at end of master problem.
    Time elapsed post processing 361.344 seconds
    Solution obtained: {<11 15.52 16.75 163852 86117 976 1515>}
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: ODBC Speed, Slow Queries

    Posted Fri June 11, 2010 11:49 AM

    Originally posted by: UDOPS


    Update: I gave up and switched to a text file import/export. I wrote a function in my database that exports the data as a .dat file with a dynamic filename, and use writeln in OPL to write a columnar text file for returning the solution. I still use ODBC to pull one record containing the problem id and key columns.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer