Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to tune SQL to avoid ORA-03232 ?

Re: How to tune SQL to avoid ORA-03232 ?

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: Wed, 16 Oct 2002 12:53:37 +0200
Message-ID: <aojgid$e8t$1@ctb-nnrp2.saix.net>


Jonathan Lewis wrote:

> A question - when do you make the trade-off between writing
> SQL which is human readable, and therefore subject to easy
> comprehension and quick modification by the next person,
> and writing SQL which is designed to do the job the optimizer
> ought to do.

Good question. Never thought about it that way. Likely because of two factors.

The CBO is not perfect. And I love to mess about wringing every drop of performance I can from my Oracle SQL. :-)

Second reason. Human readability is not really the issue IMO. And actually part of the problem. To explain - I am dealing with a couple of users with no formal programming logic training. They tackle the problem in a "common human readable way". The results are the most complex SQL statements I have ever seen. Nested selects many levels deep. Unions. Inline views. Those SQL's really run a couple of A4 page print outs.

The problem IMO is a lack of logic skills. You need to have some training and experience to translate a "human problem" into a "computer solution". Directly applying human language skills in defining the problem just like that in something like SQL... well, IMO SQL is not suited for it.

If anything, ProLog would be more able as it allows you to define the problem without needing to specify how it must be solved.

I am also not saying that one should not write readable code. I have done my share of Fortran and C/C++ maintenance on cryptic code. But there is a difference between writing programmer readable code, and human readable code.

> I like the code because it seems to say in SQL exactly
> what you mean in English.

Which is why COBOL was pretty easy to learn. And I'm sure that most people will be able to read an old COBOL program of mine and understand the basics of what it is doing, without any formal programming training. But it was hell and very frustrating to develop in COBOL.

Give that same person a Delphi/C++/Java program and he will be clueless. But I can achieve in Delphi what is impossible in COBOL. In a mere fraction of the time that it would take to write a COBOL program with even a 1/4 of the complexity of the Delphi program.

Have classes. Can instantiate. :-)

But you have raised an interesting topic Jonathan. What is the target for the SQL language? End-users/power users? Or trained and professional developers? Especially when looking at how increasingly complex and more powerful computer languages become. Where does SQL fit in?

--
Billy
Received on Wed Oct 16 2002 - 05:53:37 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US