Page 1 of 1

UniQuery open very slow with order by syntax on oracle

Posted: Mon 02 Nov 2020 05:34
by wbjsoft
Delphi XE2 - RemObjects - Unidac8 - Oracle10g

TUniQuery.Open procedure takes about 4000 ms when SQL contains order by syntax.
but it taks only 100ms when SQL contains no order-by syntax.

same data in MariaDB5.5 TUniQuery.Open takes same period

Is there any option about ordering?

thank you in advance

Re: UniQuery open very slow with order by syntax on oracle

Posted: Tue 03 Nov 2020 10:04
by MaximG
Does the ordering work fast in Oracle 10g and MariaDB when you use any other tool, e.g., the command-line tools SQL *Plus and mysql sql shell?

Re: UniQuery open very slow with order by syntax on oracle

Posted: Wed 04 Nov 2020 02:14
by wbjsoft
Yes. It is.
other tool works fast.
It is slow on TUniQuery.Open procedure

Re: UniQuery open very slow with order by syntax on oracle

Posted: Wed 04 Nov 2020 09:51
by MaximG
Please create and send us a sample project with source code where the issue can be reproduced. Also we need the DDL script that creates the tables that you use in the sample project. For your convenience, please use the e-support form https://www.devart.com/company/contactform.html

Re: UniQuery open very slow with order by syntax on oracle

Posted: Fri 06 Nov 2020 06:53
by wbjsoft
I found reason.
SpecificOptions.Values['OptimizerMode'] := 'omFirstRows';
I changed option to
SpecificOptions.Values['OptimizerMode'] := 'omDefault';

issue is solved.

does the option can make performance slow?

Re: UniQuery open very slow with order by syntax on oracle

Posted: Tue 10 Nov 2020 09:29
by MaximG
The 'OptimizerMode' option affects the query performance as it defines the Oracle optimizer settings. See the Oracle documentation for more information: https://docs.oracle.com/cd/B19306_01/se ... REFRN10145