On Sat, 2004-11-06 at 19:52, Carlos Lopez wrote: > The problem is that there are many nested views which > normally join tables by using two fields, one > character and other integer. PostgreSQL has difficulty with some multi-column situations, even though in general it has a particularly good query optimizer. If the first column is poorly selective, yet the addition of the second column makes the combination very highly selective then PostgreSQL may not be able to realise this, ANALYZE or not. ANALYZE doesn't have anywhere to store multi-column selectivity statistics. EXPLAIN ANALYZE will show you whether this is the case. It seems likely that the estimated cardinality of certain joins is incorrect. -- Best Regards, Simon Riggs