From: David Vallner Date: 2006-12-22T21:25:07+09:00 Subject: Re: string of strings... --------------enig27338423BFEC1776E36B192C Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sam Smoot wrote: > Keep in mind that temp-tables in MSSQL are still written to disk in > TempDB. So as a general rule, if you're concerned about performance, if= > you don't *need* a temp-table, don't use it. >=20 Well, the Powers That Be said "it's probably the query lag". So this should clear it. My opinion is that it's the varchar column that could use a unique index constraint, and since it's a read-only rather small table (in the order of tens of records, maybe hundreds at most) from the POV of the client app I'm working on, I'd prefer to just prefetch it on startup and stop fooling around. > Not that performance should always be a #1 concern of course. Just that= > I've seen hundreds if not thousands of stored-procedures that use > temp-tables as a matter of course just because the developer wasn't > comfortable with sub-selects, grouping, etc. I'm sure you won't fall > into that trap though. :-) >=20 Erm. Using a temp table to store data that -already is- in the DB? Eugh. I presume that's the same kind of developer that's not comfortable with nesting function calls and gets into 9 levels of indentation and umpty local variables. And if I have the necessary privileges on a DB, any and all subselects I see are very good candidates to be axed and put into a view. > There are also in-memory tables, but I don't remember the caveats. I > think perhaps they might have a global scope or something inconvienent > like that, but don't quote me on that. >=20 This is Oracle 8i, working in Mysterious Ways (tm), and the only temp tables you get are globally scoped with locally scoped data. Luckily I think developers have create table rights, so it should be possible to sneak this in. Right, thanks for the hints! David Vallner --------------enig27338423BFEC1776E36B192C Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (MingW32) iD8DBQFFi86dy6MhrS8astoRAofJAJ9ofmJKo7HWDKTDZ12WA0XllhC3JACfYXzo f8KwpbzksJJBoMPiRqpHZqk= =jqst -----END PGP SIGNATURE----- --------------enig27338423BFEC1776E36B192C--