akardapolov / ASH-Viewer

ASH Viewer provides a graphical view of active session history data within the Oracle and PostgreSQL DB
GNU General Public License v3.0
167 stars 72 forks source link

Using ALL ROWS for queries #59

Closed rstribrn closed 2 years ago

rstribrn commented 2 years ago

In case DB default is not used...

xtender commented 2 years ago

It would be better to not change queries, but execute alter session set optimizer_mode=ALL_ROWS after connect: hint ALL_ROWS disables FKR (First K-rows) optimization in case of "rownum" in predicates

akardapolov commented 2 years ago

Hi @rstribrny

I propose to set optimizer_mode=ALL_ROWS in session by @xtender's recommendation (for example here https://github.com/akardapolov/ASH-Viewer/blob/master/ashv/src/main/java/gui/connect/ConnectToDbArea.java).

Thanks, Alex.

rstribrn commented 2 years ago

Thank you both for your feedback.

I've reimplemented it the way you suggested => using alter sessions (however for any new connection, per profile type/name).

There are also 2 other minor changes:

Tested with DB 19c.

akardapolov commented 2 years ago

Well done