|
Vern, On 4/18/06, vhamberg@xxxxxxxxxxx <vhamberg@xxxxxxxxxxx> wrote: > Are you sure there's no where clause? It's in the subquery (where exists...), > I think. > > The point is that "where exists" does not do a full table scan to return a > result, therefore it is very fast. I meant, no where clause in the subselect inside the where exists(). mine had a LIKE '____xxxx___' compare in the subselect, which runs much slower, especially if the first match is deep into the access path it chooses. I tested it - if the first match was towards the beginning of the chosen access path, it found it sub-second. near the end, it was more like 6-10 secs. > I'm not sure whether the select into is faster - probably no noticeable > difference. no, I don't think select '1' is any faster, I just like it better. it returns 1 to my indicator variable when successful, and I can test for (not $found). I tried both ways and found no noticable difference. > To explain further, the "select 1 from..." is working against a single-row > table, hence it > returns a single value and can be assigned to the host variable (I think that > makes > sense). It'd probably fail if the "select 1 from..." returned multiple rows. my first attempt (without the sysdummy1 file) did fail. I'd never heard of the sysdummy1 file. > The idea is to test for records in a file, so that file name goes into the > innermost select. > > HTH it does, thanks! Rick
As an Amazon Associate we earn from qualifying purchases.
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.