On 1/10/11 12:57 PM, Bryce Martin wrote:
Won't the multiple select statement have a negative impact on
performance compared to a list of predetermined values?

"Schutte, Michael Don01/10/2011 03:36 PM wrote:

Change this to...

Select Cast(rncust As Numeric(6,0)),
Cast(rnseq As Numeric(4,0)),
Cast(rntype As Numeric(2,0)),
rnword1, rnword2, rnword3, rnword4, rnword5
From rcm002pf
Where rnword1 in (select WorkKey1 from WorkTable1)


The real issue for performance impact would be for the /maintenance/ on the work table [i.e. drop, create, open, insert, clear...] rather than the much smaller impact of running and using the result of the subselect. If the input string is as easily parsed as the example, then I believe a recursive CTE breaking the string into rows [of a true temporary file as created by the database scoped to that SELECT] would perform noticeably faster than using a user-created work table.

Regards, Chuck

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.