pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Stark <gsstark@mit.edu>
To: Jim C. Nasby <jim@nasby.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: Poor performance of group by query
Date: 16 Apr 2004 18:57:51 -0400
Message-ID: <87pta78r9s.fsf@stark.xeocode.com> (raw)
In-Reply-To: <20040416151706.GE87362@nasby.net>
References: <20040416151706.GE87362@nasby.net>



> stats=# explain analyze SELECT work_units, min(raw_rank) AS rank  FROM Trank_work_overall GROUP BY work_units;
>
> ...
>
>  raw_rank   | bigint | 
>  work_units | bigint | 


If you create a copy of the same table using regular integers does that run
fast? And a copy of the table using bigints is still slow like the original?

I know bigints are less efficient than integers because they're handled using
dynamically allocated memory. This especially bites aggregate functions. But I
don't see why it would be any slower for a hash aggregate than a regular
aggregate. It's a pretty gross amount of time for 18k records.

There was a thought a while back about making 64-bit machines handle 64-bit
datatypes like bigints without pointers. That would help on your Opteron.


-- 
greg




view thread (4+ messages)  latest in thread

Message-ID: <87pta78r9s.fsf@stark.xeocode.com>
Permalink:  ../87pta78r9s.fsf@stark.xeocode.com/
Also on:    postgresql.org/message-id/87pta78r9s.fsf@stark.xeocode.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: gsstark@mit.edu, jim@nasby.net
  Subject: Re: Poor performance of group by query
  In-Reply-To: <87pta78r9s.fsf@stark.xeocode.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox