Non-replicated index allowing comparison ("<")?

Started by Björn Edströmover 13 years ago2 messagesgeneral
Jump to latest
#1Björn Edström
bjorn@spotify.com

Greetings list.

I have a Postgresql 9.0.8 cluster with one master and a few slaves, in
a hot standby and streaming replication setup. The setup has a single
database with a single table. The table has a column "updated" of type
"timestamp".

For maintenance reasons I'd like to create a B-tree (or at least some
kind of index allowing fast comparisons, "<" and ">" at least).
However, I'd, if possible, like to create this index on a single
machine in the cluster and not have it replicated everywhere. When the
maintenance is done the index should be removed. Hash indices will not
work in this case - it's non-replicated but does not work for
comparisons.

Ideas?

Best regards
Björn

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Magnus Hagander
magnus@hagander.net
In reply to: Björn Edström (#1)
Re: Non-replicated index allowing comparison ("<")?

On Nov 29, 2012 8:59 PM, "Björn Edström" <bjorn@spotify.com> wrote:

Greetings list.

I have a Postgresql 9.0.8 cluster with one master and a few slaves, in
a hot standby and streaming replication setup. The setup has a single
database with a single table. The table has a column "updated" of type
"timestamp".

For maintenance reasons I'd like to create a B-tree (or at least some
kind of index allowing fast comparisons, "<" and ">" at least).
However, I'd, if possible, like to create this index on a single
machine in the cluster and not have it replicated everywhere. When the
maintenance is done the index should be removed. Hash indices will not
work in this case - it's non-replicated but does not work for
comparisons.

Ideas?

This is not possible with streaming replication. You'd have to look at one
of the external replication solutions out there, like Slony. In sr, you
need to create it on the master and have it replicate everywhere.

/Magnus