Not In Too Slow
Hello. I have a simple performance problem.
It's a common configuration error to have a user account, but no extended information about them. To help administrators identify this, I've created two views. Anyone who is in view 1, but not view 2 is a potential problem, so I'd like to show them to administrators in a report.
The problem is that the statement:
select user_name from view1 where user_name not in view2;
is a real dud. It rarely returns in a reasonable amount of time. Table 1 has about 6000 entries and view2 has about 500 entries.
How should I be doing this?