Re: [GENERAL] index not used with subselect in where clause ?

2001-04-17 Thread Tom Lane
Christian Fritze [EMAIL PROTECTED] writes: explain select * from allmain where exists (select distinct dokids_as_int from allslwfull where dokids_as_int = idn and wort_nouml_lower like 'gen%') Try dropping the "distinct" on the inner select. As a moment's thought will reveal, it's

Re: [GENERAL] index not used with subselect in where clause ?

2001-04-17 Thread Rod Taylor
Adding a LIMIT 1 in the subplan may also help -- as you only need a single match to make it true so additional finds are useless -- it'll stop sooner or will be more likely to use an index than a full table scan. -- Rod Taylor There are always four sides to every story: your side, their side,

Re: [GENERAL] index not used with subselect in where clause ?

2001-04-17 Thread Tom Lane
"Rod Taylor" [EMAIL PROTECTED] writes: Adding a LIMIT 1 in the subplan may also help -- as you only need a single match to make it true so additional finds are useless -- it'll stop sooner or will be more likely to use an index than a full table scan. I believe this is not necessary; the

Re: [GENERAL] index not used with subselect in where clause ?

2001-04-17 Thread Christian Fritze
Adding a LIMIT 1 in the subplan may also help -- as you only need a single match to make it true so additional finds are useless -- it'll stop sooner or will be more likely to use an index than a full table scan. -- Rod Taylor I'm not sure if I understand you correctly here: the subplan