服务表现的问题,如何提高查询的下面LEFT OUTER JOIN PostgreSQL中
select
distinct o1.id as c1,
a1.id as c2,
o1.t1_id as c3,
o1.t2_id as c4,
o1.t_p_id as c5
from
ord o1
left outer join
acc a1
on o1.end_user_id=a1.id
left outer join
acc a2
on 1.t1_id=a2.id
left outer join
acc a3
on o1.t2_id=a3.id
left outer join
acc a4 on
o1.t_p_id=account4_.id
where
a1.account_id=1 or a2.account_id=1 or a3.account_id=1 or a4.account_id=1;
请阅读:http://wiki.postgresql.org/wiki/Slow_Query_Questions并发布更多信息。 – 2013-02-22 06:54:04
没有表DDL,索引,'EXPLAIN ANALYZE'输出,服务器配置,无法说任何... – vyegorov 2013-02-22 07:07:15
请详细说明。 http://stackoverflow.com/tags/postgresql-performance/info – 2013-02-22 07:08:23