From: PFC <lists@peufeu.com>
To: Rauan Maemirov <rauan1987@gmail.com>
To: pgsql-performance@postgresql.org
Subject: Re: Creating indexes
Date: Thu, 08 May 2008 22:08:17 +0200
Message-ID: <op.uaup73lxcigqcu@apollo13.peufeu.com> (raw)
In-Reply-To: <050368ea-4090-4d4e-aef7-b9f2ac06da56@x35g2000hsb.googlegroups.com>
References: <050368ea-4090-4d4e-aef7-b9f2ac06da56@x35g2000hsb.googlegroups.com>
> Hi, all. I want to ask what type of index is better to create for
> bigint types. I have table with bigint (bigserial) primary key. What
> type is better to use for it? I tried btree and hash, but didn't
> notice any differences in execution time. For GiST and GIN there is a
> trouble that I must create operator class, so I limited myself to use
> btree or hash. But if it's better to use gist or gin, coment are
> welcome.
If you use BIGINT, I presume you will have lots of different values, in
that case the best one is the btree. It is the most common and most
optimized index type.
GiST's strength is in using indexes for stuff that can't be done with a
simple btree : geometry, full text, ltree, etc, but gist is slower in the
case of indexing a simple value.
GIN indexes are more compact and very fast for reads but updating is very
slow (they are meant for mostly read-only tables).
Hash is a bit of a fossil. Also it does not support range queries, so if
you need that, btree is definitely better.
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: lists@peufeu.com, rauan1987@gmail.com
Subject: Re: Creating indexes
In-Reply-To: <op.uaup73lxcigqcu@apollo13.peufeu.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