Re: Oracle View Machanism - Opinions Please!!!!!!

From: Paul Beardsell <paul_at_hoxton.demon.co.uk>
Date: Wed, 18 May 1994 01:25:08 +0000
Message-ID: <769224308snz_at_hoxton.demon.co.uk>


In article <tedh.769204546_at_tus.ssi1.com>

           tedh_at_delab4.tus.ssi1.com "Ed Henderson" writes:

>scoec_at_westminster.ac.uk (Michael j Dorey) writes:
>
>>Does anyone on this system have any views/comments etc. on the use of the
>>Oracle (SQL) view mechanism? This is a peeve directed to a particular
>>lecturer here (who will remain nameless) but who is under the impression
>>that when designing a database you should not create views which are
>>themselves based (or partly based) on other views. When I questioned 'why?'
>>I was given no specific reasoning. The solution to many database problems
>>can (of course) be enhanced by using views, and in my view (no pun
>>intended!) breaking a complex set of requirements into small
>>problem-specific views which may then be linked together into a larger
>>view and perhaps to another base table is perfectly logical, and one of the
>>plusses of the relational model?? It might also be considered a simple
>>extension of functional programming, breaking a problem into specific
>>procedures or modules. I would be grateful on any opinions on this - I have
>>to add I've seen nothing in any books which discourages it, (in fact it was
>>encouraged on a course I attended in 1991) and surely it enhances future
>>maintainablity of the system as well???
>
> Well I would not design a system based on a heirarchical system of views. I
>would carefully consider my project and find a better way.
> I am a firm believer in structured systems. However, structured systems
>must balance development time - portability - maintainability - and
>performance.
> You seem pre-disposed toward your 'view' structure. Such a structure
>would most likely perform quite sluggishly. I would reccomend that you take
>a step back and consider your position more carefully. I have often times
>found myself re-evaluating a circumstance after such an 'objective'
>analysis of my own projects.
>
>Ed Henderson
>

Nonsense, Ed! In my (not so) humble opinion, that is. The problem is with poor query analysers. I say: Continue to write structured code - your database vendor has addressed / is addressing / will address / should address this problem. Views on views are great. If you hit a performance problem (and you probably won't) then think about reducing the nesting. The same advice was offered routinely to 3GL programmers back in the days when compilers were not all that good:

"Code it in a high-level language, we'll re-write bits in assembly if necessary."

Note how compilers often produce better machine code than programmers nowadays. Query analysers are getting there too.

Just as patriotism is the last refuge of the scoundrel, performance is the last refuge of the writer of poorly structured code.

-- 
Paul Beardsell                          SAM Business Systems Ltd
~~~~~~~~~~~~~~                          21 Finn House, Bevenden St, HOXTON,
pbeardsell_at_cix.compulink.co.uk          Hackney, London, N1-6BN, UK.
paul_at_hoxton.demon.co.uk                 (+44 or 0)71 608-2391
Received on Wed May 18 1994 - 03:25:08 CEST

Original text of this message