Excerpts from Matthew Wakeling's message of mar ago 10 11:40:16 -0400 2010:
> I am trying to retrieve, for many sets of rows grouped on a couple of
> fields, the value of an ungrouped field where the row has the highest
> value in another ungrouped field.
I think this does what you want (schema
Original query:
explain analyse select * from tracker where objectid < 120;
QUERY PLAN
---
Index Scan using tracker_objectid on tracker
(cost=0.00..915152.62 rows=3684504 width=33)
(
ct: Re: [PERFORM] Sorted group by
Matthew Wakeling wrote:
> I'm trying to eke a little bit more performance out of an application
In addition to the suggestion from Thomas Kellerer, it would be interesting
to try the following and see how performance compares using real data.
select gro
Matthew Wakeling wrote:
> I'm trying to eke a little bit more performance out of an
> application
In addition to the suggestion from Thomas Kellerer, it would be
interesting to try the following and see how performance compares
using real data.
select group, value from tbl x
where not exis
On 10 August 2010 17:06, Thom Brown wrote:
> On 10 August 2010 17:03, Matthew Wakeling wrote:
>> On Tue, 10 Aug 2010, Thomas Kellerer wrote:
>>>
>>> No. It's built in (8.4) and it's called Windowing functions:
>>> http://www.postgresql.org/docs/8.4/static/tutorial-window.html
>>> http://www.postg
Matthew Wakeling wrote on 10.08.2010 18:03:
On Tue, 10 Aug 2010, Thomas Kellerer wrote:
No. It's built in (8.4) and it's called Windowing functions:
http://www.postgresql.org/docs/8.4/static/tutorial-window.html
http://www.postgresql.org/docs/8.4/static/functions-window.html
SELECT group, last_
On Tue, Aug 10, 2010 at 04:40:16PM +0100, Matthew Wakeling wrote:
>
> I'm trying to eke a little bit more performance out of an
> application, and I was wondering if there was a better way to do the
> following:
>
> I am trying to retrieve, for many sets of rows grouped on a couple
> of fields, t
On 10 August 2010 17:03, Matthew Wakeling wrote:
> On Tue, 10 Aug 2010, Thomas Kellerer wrote:
>>
>> No. It's built in (8.4) and it's called Windowing functions:
>> http://www.postgresql.org/docs/8.4/static/tutorial-window.html
>> http://www.postgresql.org/docs/8.4/static/functions-window.html
>>
On Tue, 10 Aug 2010, Thomas Kellerer wrote:
No. It's built in (8.4) and it's called Windowing functions:
http://www.postgresql.org/docs/8.4/static/tutorial-window.html
http://www.postgresql.org/docs/8.4/static/functions-window.html
SELECT group, last_value(value) over(ORDER BY number)
FROM table
Matthew Wakeling wrote on 10.08.2010 17:40:
Currently, I do this in my application by ordering by the number and
only using the last value. I imagine that this is something that can be
done in the new Postgres 9, with a sorted group by - something like this:
SELECT group, LAST(value, ORDER BY nu
I'm trying to eke a little bit more performance out of an application, and
I was wondering if there was a better way to do the following:
I am trying to retrieve, for many sets of rows grouped on a couple of
fields, the value of an ungrouped field where the row has the highest
value in anoth
11 matches
Mail list logo