UniQuery open very slow with order by syntax on oracle

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
wbjsoft
Posts: 24
Joined: Tue 08 Aug 2006 00:38

UniQuery open very slow with order by syntax on oracle

Post by wbjsoft » Mon 02 Nov 2020 05:34

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

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

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

Post by MaximG » Tue 03 Nov 2020 10:04

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?

wbjsoft
Posts: 24
Joined: Tue 08 Aug 2006 00:38

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

Post by wbjsoft » Wed 04 Nov 2020 02:14

Yes. It is.
other tool works fast.
It is slow on TUniQuery.Open procedure

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

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

Post by MaximG » Wed 04 Nov 2020 09:51

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

wbjsoft
Posts: 24
Joined: Tue 08 Aug 2006 00:38

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

Post by wbjsoft » Fri 06 Nov 2020 06:53

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?

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

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

Post by MaximG » Tue 10 Nov 2020 09:29

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

Post Reply