Re: [SQL] Strange Execution-Plan for NOT EXISTS

2001-01-08 Thread Tom Lane
Jens Hartwig <[EMAIL PROTECTED]> writes: > select (min(id) + 1) > from t_dummy d1 > where not exists ( > select id > from t_dummy d2 > where d2.id = (d1.id + 1) > ); > Aggregate (cost=2924207.88..2924207.88 rows=1 width=12) -> Seq Scan on t_dummy d1 (cost=0.00..2924207.88 rows=1 wid

[SQL] Strange Execution-Plan for NOT EXISTS

2000-12-28 Thread Jens Hartwig
Hello all, I tried (just for academical fun) to resolve ID´s which are not used anymore, e.g.: ID NAME -- + -- 1 | NOBODY 2 | ANYBODY 4 | EVERYBODY Now I want to get "3" as the next usable ID. I really know that this is kind of bad style but a friend of mine asked me if I h