Code explanation needed

Can someone put in understandable description what this code is doing?

select /*+ no_parallel_index(t,"IDX_LEDGERTEMP_CONNID") dbms_stats cursor_sharing_exact use_weak_name_resl dynamic_sampling(0) no_monitoring no_expand index(t,"IDX_LEDGERTEMP_CONNID") */ count(*) as nrw,count(distinct sys_op_lbid(124888,'L',t.rowid)) as nlb,count(distinct "CONN_ID") as ndk,sys_op_countchg(substrb(t.rowid,1,15),1) as clf from "NIS1"."LEDGERENTRY_TEMP" t where "CONN_ID" is not null
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

sdstuberConnect With a Mentor Commented:
If you're looking for a more detailed explanation, you'd have to go to oracle to get a complete and accurate description of each step...

but in general, what it's doing is

scanning your table using an index in one session (no-parallel means don't multi-thread it)
cursor_sharing_exact tells the optimizer to NOT replace constants with bind variables, but to use the sql statement "as-is".

it's reading every row of data, rather than randomly sampling some percentage. and counting the total number of rows and distinct values and by parsing the rowid is gathering the clustering and leaf block information.
It's doing an analyze of your table to gather index information.

Most of those hints aren't usable by developers in their applications.
That is an oracle internal script used to gather stats.
Yes, I guess I wasn't specific enough  the "analyze" I was referring to was initiated by a call to the dbms_stats package.

All Courses

From novice to tech pro — start learning today.