Re: [HACKERS] strange cost for correlated subquery

2008-03-16 Thread Tom Lane
"Pavel Stehule" <[EMAIL PROTECTED]> writes: > It's strange, so correlated subqueries is faster, but it has much higher cost: In the nestloop plan, the estimated cost for the indexscan is discounted based on the knowledge that it'll be executed repeatedly: >-> Index Scan using fxx

[HACKERS] strange cost for correlated subquery

2008-03-16 Thread Pavel Stehule
Hello I tested speed SELF JOIN and correlated subquery for couting of subtotals: It's strange, so correlated subqueries is faster, but it has much higher cost: postgres=# explain analyze select t1.id, t1.sale_date, t1.product, t1.sale_price, sum(t2.sale_price) from history t1 inner join history