Subject | IN clause - using static values vs table values |
---|---|
Author | Gary Benade |
Post date | 2006-08-08T10:07:44Z |
This was posted in IBO earlier by mistake. Sorry.
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