Re: [despammed] question about index

From: Andreas Kretschmer <akretschmer(at)despammed(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: [despammed] question about index
Date: 2004-12-16 11:01:39
Message-ID: 20041216110139.GA5899@Pinguin.wug-glas.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

am 16.12.2004, um 11:41:54 +0100 mailte Jerome Alet folgendes:
> Hi,
>
> For a future databas, I plan to have got a table with a text field
> which can contain only three different values, say "VALUE1",
> "VALUE2", and "VALUE3"

Why text-fields for this task? I would prefer a smallint for this with a
check-contraint to check the values.

> be as fast as possible.
>
> considering that almost 70% of the rows will be with 'VALUE1', 20%
> will be with 'VALUE2' and 10% will be with 'VALUE3' on the average.
>
> should I create an index to speedup the counts or not ?

Yes.

Andreas
--
Andreas Kretschmer (Kontakt: siehe Header)
Tel. NL Heynitz: 035242/47212
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
=== Schollglas Unternehmensgruppe ===

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Janning Vygen 2004-12-16 11:21:15 Re: Query aid
Previous Message Jerome Alet 2004-12-16 10:41:54 question about index