Re: [PERFORM] Performance issue: index not used on GROUP BY...

2014-09-03 Thread gmb
Thanks for the feedback, everybody. I spent a couple of days trying to optimise this; As mentioned , the increased memory is not an option for me, as this query is part of a report that can be run by any user on an ad hoc basis. Allocating the required memory to any session on demand is not feasi

Re: [PERFORM] Performance issue: index not used on GROUP BY...

2014-08-28 Thread gmb
Thanks for these suggestions Unfortunately , I don't have a lot of memory available ( 65 connections , work_mem = 64MB in pg conf ). >> I think index will be of no help here, as (1) you're reading whole table >> anyway and (2) `amount` is not part of your index. I did not think that the the fie

Re: [PERFORM] Performance issue: index not used on GROUP BY...

2014-08-28 Thread gmb
> Can you send `EXPLAIN (analyze, buffers)` for your query instead? > It'll show exactly what's going on. GroupAggregate (cost=303425.31..339014.43 rows=136882 width=48) (actual time=4708.181..6688.699 rows=287268 loops=1) Buffers: shared read=23899, temp read=30974 written=30974 -> Sort

[PERFORM] Performance issue: index not used on GROUP BY...

2014-08-28 Thread gmb
please confirm whether aggregate functions such as GROUP BY should use indexes ? Thanks in advance gmb -- View this message in context: http://postgresql.1045698.n5.nabble.com/Performance-issue-index-not-used-on-GROUP-BY-tp5816702.html Sent from the PostgreSQL - performance mailing list