Ignore hash indices on replicas - Mailing list pgsql-general

From Steven Schlansker
Subject Ignore hash indices on replicas
Date
Msg-id 84691ED0-98AB-4AA7-AEC4-459807020156@likeness.com
Whole thread Raw
Responses Re: Ignore hash indices on replicas  (Jeff Davis <pgsql@j-davis.com>)
Re: Ignore hash indices on replicas  (Scott Marlowe <scott.marlowe@gmail.com>)
List pgsql-general
I'm using Postgres hash indices on a streaming replica master.
As is documented, hash indices are not logged, so the replica does not have access to them.

I understand that the current wisdom is "don't use hash indices", but (unfortunately?) I have benchmarks that
show that our particular application is faster by quite a bit when a hash index is available.

I assume that fixing the hash index logging issue hasn't been a priority due to low interest / technical limitations,
butI'm curious for a stopgap measure -- can we somehow configure Postgres to ignore hash indices on a replica, using
otherb-tree indices or even a sequential scan?  I know I can do this on a per-connection basis by disabling various
indexlookup methods, but it'd be nice if it just ignored invalid indices on its own. 

I've not seen much reference to this problem around, but I do apologize if I've missed it in the manual or it is
extremelyobvious how you do this :) 

Thanks,
Steven


pgsql-general by date:

Previous
From: Stefan Schwarzer
Date:
Subject: Re: ERROR: function crosstab(unknown, unknown) does not exist
Next
From: tuanhoanganh
Date:
Subject: PL/Python error fetching next item from iterator