Queries in DBD::Oracle use the RULE hint, as the solution to the problem
arising from this thread:


Gathering statistics on the SYS schema in Oracle 9.2 was supported, but
produced very bad execution plans that caused t/meta to hang.

Oracle said they were going to remove the Rule Based Optimiser in 10g, which
would have made /*+RULE*/ an invalid hint and hence ignored silently.
However, they've gone down the path of keeping the RBO, but making it

So this means that the data dictionary queries issued by DBD::Oracle are now
using a desupported feature, so if it ever caused a problem in any way,
Oracle Support's first reply would be 'remove the rule hints, not a
supported feature'.

Attached patch uses ora_server_version to determine whether to insert the
hint or not; data dictionary queries will be issued unhinted in 10g, and
since Oracle 10g automatically gathers stats on everything in sight, it will
use CBO.

I've tested it on a 10g Linux database, and it doesn't exhibit the hangs
that it did in 9i without the hint - verified that Oracle itself had indeed
gathered stats on SYS, so they must have fixed the optimiser's behaviour on
the SYS schema.

Also tested on 9.2, queries were issued hinted with RULE as before.

Whilst I'm on 10g issues, the behaviour of 'DROP TABLE' has changed in 10g -
it doesn't actually drop the table unless you use 'DROP TABLE xxx PURGE'
now, it puts it in a 'recycle bin'. Should the DBD::Oracle tests add 'purge'
to the drop tables if it's running against 10g? Or should it not bother -
it's the DBA's job/decision to purge the recycle bin regularly?

Andy Hassall <[EMAIL PROTECTED]> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>

Attachment: DBD-Oracle-conditional-rule-hint-rev227.patch
Description: Binary data

Reply via email to