Ditto your point on asking the right questions, and I've been using SQL for
at least 10 years now. I think I've done some fancy stuff with SQL, but
I'm sure I've only scratched the surface of the possibilities. I've seen
some really amazing SQL posted in this forum and am reminded of how little
I know.

Charles' comment wrt using LFs notwithstanding, another possibility for
your 20-minute query on the PF and just "seconds" for the query using the
LF is that the query engine is apt to build temporary indexes, and may have
done so for your first query, and that index was still available (and
"compatible") with your second query.

I've run the same query twice in a row. The first iteration takes 20
minutes, and subsequent queries complete in seconds, if they are executed
soon after the previous query.. If I wait 5 minutes or so to run the same
query again, that query takes 20 minutes.

- Dan

On Thu, Sep 3, 2015 at 4:28 PM, Alan Shore <ashore@xxxxxxxx> wrote:

Hi Booth

I understand and agree with your comment about your biggest problem being
that you haven't yet figured out how to ask the right questions.

I have been using SQL for quite a few years now - and I STILL not yet
figured out how to ask the right questions.

When I first started using SQL - I was told - ALWAYS use the physical with
your selects (or omits) within the SQL script (although I could never find
out why)

I followed this directive UNTIL I had to run one particular (relatively
simple) SQL script.
It gave me the answers I was looking for - but it took a rather long time
to run - 20 minutes or so - a LARGE file
So just for the hell of it, I changed the script to use a logical (for the
selects and omits) and it literally took seconds - with the same results

Nowadays - I still tend to use the physical - but I keep the idea of using
a logical in the back of my head
Alan Shore


This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2019 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].