var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Query taking forever
The following query is taking forever to run on DB2...
select count (*) from SONG_KNOWLEDGE_BASE where SONG_CD not in (select SONG_CD from SONG)
It looks simple. I have heard that NOT IN should not be used, is this true. Can someone help me rewrite this query?
You could try something like this, it should perform better
Having indexes on SONG_CD will help as well.
select count (*)
from SONG_KNOWLEDGE_BASE skb
where not exists (select 1
from SONG s
where skb.SONG_CD =s.SONG_CD)