There is no black magic.
Run DB monitor for your query and use SQL Visual Explain from Operations
Navigator.
It will show you how your query was performed in more detail than you want
;-)

    Alexei Pytel
always speaking for myself




                      "Joe Pluta"
                      <joepluta@PlutaBro        To:       
<midrange-l@midrange.com>
                      thers.com>                cc:
                      Sent by:                  Subject:  RE: SQL Syntax
                      midrange-l-admin@m
                      idrange.com


                      10/29/2002 11:02
                      AM
                      Please respond to
                      midrange-l





> From: jpcarr@tredegar.com
>
> The first with a IN statement would be done in one pass,   doing
> sortof a "Lookup" compare of the values in the list.
>
> The second has an OR statement,   One way the optimizer would do
> this is to
> create a bitmap of both sides of the OR predicate then XOR to a final
> bitmap.
> (Not saying that is what it did, just that it could have taken this
> route)

It's this last bit that bothers me.  It "could have" done this.  It could
have phoned out for pizza, for all we know.  The fact that SQL "does stuff"
under the covers doesn't mean it's doing "the right stuff".

When we write native DB2, we know exactly how we're accessing the database,
and while we can certainly write bad code, that's a programmer issue, not a
"black box" issue.  If somebody consistently writes stupid database code,
then they should find other work.  But it's relatively easy to diagnose
stupid database code by looking at the source.

With SQL, you really don't know if you've done something stupid.  In my
case, I evidently did something stupid.  However, adding a logical view
fixed it.  So now it's not stupid anymore.  Why?  I dunno.  You dunno.
Nobody on the list seems to know.

Yet, this is the technology we're supposed to base our mission critical
systems on.  It reminds me of the old flow chart we had on the wall at SSA.
We had user input at the beginning, and output at the end.  In the middle
was a big black box labeled "A Miracle Occurs".  That's sort of what SQL is
like, especially with more complex syntaxes.

But hey, I'm biased towards native DB2 as we all know.  But doesn't this
sort of black magic worry ANYBODY else?

Joe

_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
or email: MIDRANGE-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.






As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.