Rob,

First, there are a number of logicals (including indicies) over that file,
check again. As for the temp table, I didn't realize that IN required on,
but it makes sense. According to a visual explain of that query on my
machine the temp table contained only 1 row. I reran the query with "fetch
first 50 rows" and the temp table contained 50 rows so my guess at the
implementation of FETCH FIRST N is that if build a cursor for the select and
then iterates over the cursor N times and loads a temp file. It then returns
the contents of that temp file.

So, to answer your question, it wouldn't copy either the logical or the
physical, it's just a holding area.

Also, I would have three statements in your program, one for library only,
one for library/file and one for library/file/field. Don't make the
optimizer look at data you don't care about.

-Walden


------------
Walden H Leverich III
President
Tech Software
(516) 627-3800 x11
(208) 692-3308 eFax
WaldenL@TechSoftInc.com
http://www.TechSoftInc.com



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.