"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
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