Re: [HACKERS] Thinking about IN/EXISTS optimization

2002-11-29 Thread Mike Benoit
On Fri, 2002-11-29 at 13:22, Tom Lane wrote: > Mike Benoit <[EMAIL PROTECTED]> writes: > > I'm just curious, will your proposed in/exists optimizations help for > > queries like: > > > db=# explain delete from dns_expired_domains where domain_id in (select > > domain_id from dns_expired_domains gr

Re: [HACKERS] Thinking about IN/EXISTS optimization

2002-11-29 Thread Tom Lane
Mike Benoit <[EMAIL PROTECTED]> writes: > I'm just curious, will your proposed in/exists optimizations help for > queries like: > db=# explain delete from dns_expired_domains where domain_id in (select > domain_id from dns_expired_domains group by domain_id having count(*)=14 > ); Probably, but I

Re: [HACKERS] Thinking about IN/EXISTS optimization

2002-11-29 Thread Mike Benoit
Tom, I'm just curious, will your proposed in/exists optimizations help for queries like: db=# explain delete from dns_expired_domains where domain_id in (select domain_id from dns_expired_domains group by domain_id having count(*)=14 ); NOTICE: QUERY PLAN: Seq Scan on dns_expired_domains (cost

Re: [HACKERS] Thinking about IN/EXISTS optimization

2002-10-22 Thread Bruce Momjian
This sounds like one of those classic optimizer problems we have had to deal with in the past. I suggest you go through the optimizer pass and set a boolean in Query whenever you do something that may require another loop through, then at the end, you check the boolean and loop if required. I th

[HACKERS] Thinking about IN/EXISTS optimization

2002-10-22 Thread Tom Lane
I've been thinking about how to convert "x IN (subselect)" and EXISTS constructs into join-like processing, and I've run into a small problem in getting the planner to do it nicely. The issue is that I need to take the subselect and push it into the jointree --- essentially, make it look like a su