pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Manfred Koizar <mkoi-pg@aon.at>
To: mlennert@club.worldonline.be
Cc: pgsql-sql@postgresql.org
Subject: Re: performance question
Date: Mon, 20 Jan 2003 16:13:37 +0100
Message-ID: <1k3o2v01b5ceh937kibrojn2fjks3fc93t@4ax.com> (raw)
In-Reply-To: <59665.164.15.128.4.1043062834.squirrel@http://moritz.homelinux.org>
References: <59665.164.15.128.4.1043062834.squirrel@http://moritz.homelinux.org>

On Mon, 20 Jan 2003 12:40:34 +0100 (CET), "Moritz Lennert"
<mlennert@club.worldonline.be> wrote:
>I have a table with some 2.2 million rows on a Pentium4, 1.8GHz with 512
>MB RAM.
>Some queries I launch take quite a long time, and I'm wondering whether
>this is normal,or whether I can get better performance somehow.

Moritz, we need more information.  Please show us
 . your PG version
 . CREATE TABLE ...
 . indices
 . your query
 . EXPLAIN ANALYZE output
 . your settings, especially shared_buffers, sort_mem,
random_page_cost, effective_cache_size

>One question I asked myself is whether the use of char(2) is the best
>option. The column (and most others in the table) contains codes that
>designate different characteristics (for ex. in a column 'sex' one would
>find '1'=male, '2'=female).

char(2) needs 8 bytes, smallint only 2 bytes (unless followed by a
column with 4 or 8 byte alignment).  Instead of char(1) (8 bytes) you
might want to use the Postgres specific type "char" (with the double
quotes!) needing only 1 byte.

Servus
 Manfred



view thread (19+ messages)  latest in thread

Message-ID: <1k3o2v01b5ceh937kibrojn2fjks3fc93t@4ax.com>
Permalink:  ../1k3o2v01b5ceh937kibrojn2fjks3fc93t@4ax.com/
Also on:    postgresql.org/message-id/1k3o2v01b5ceh937kibrojn2fjks3fc93t@4ax.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-sql@postgresql.org
  Cc: mkoi-pg@aon.at, mlennert@club.worldonline.be
  Subject: Re: performance question
  In-Reply-To: <1k3o2v01b5ceh937kibrojn2fjks3fc93t@4ax.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