> I'm not an SQL or PostgreSQL expert. > > I'm getting abysmal performance on a nested query and > need some help on finding ways to improve the performance: [snip] > select * from attributes_table where id in (select id from > attributes where (name='obsid') and (value='oid00066'));
This is the classic IN problem (much improved in 7.4 dev I believe). The recommended approach is to rewrite the query as an EXISTS form if possible. See the mailing list archives for plenty of examples. Could you not rewrite this as a simple join though? - Richard ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster