Subject | in clause - using static values vs table values |
---|---|
Author | Gary Benade |
Post date | 2006-08-08T09:02:51Z |
Hi
Say I have a table TEMP containing the values 1,2,3,4
SELECT * FROM LARGETABLE WHERE MAININDEXVALUE IN (1,2,3,4)
SELECT * FROM LARGETABLE WHERE MAININDEXVALUE IN ( SELECT * FROM TEMP)
Does the second statement get optimised to execute as efficiently as the
first, or is there a performance penalty?
TIA
Gary
Say I have a table TEMP containing the values 1,2,3,4
SELECT * FROM LARGETABLE WHERE MAININDEXVALUE IN (1,2,3,4)
SELECT * FROM LARGETABLE WHERE MAININDEXVALUE IN ( SELECT * FROM TEMP)
Does the second statement get optimised to execute as efficiently as the
first, or is there a performance penalty?
TIA
Gary