Re: 10+hrs vs 15min because of just one index - Mailing list pgsql-performance

From Markus Schaber
Subject Re: 10+hrs vs 15min because of just one index
Date
Msg-id 43EFA2D2.1050609@logix-tt.com
Whole thread Raw
In response to Re: 10+hrs vs 15min because of just one index  (Aaron Turner <synfinatic@gmail.com>)
List pgsql-performance
Hi, Aaron,

Aaron Turner wrote:

> 4) Does decoding the data (currently base64) and storing the binary
> data improve the distribution of the index, thereby masking it more
> efficent?

Yes, but then you should not use varchar, but a bytea.

If your data is some numer internally, numeric or decimal may be even
better.

If most of your data is different in the first 8 bytes, it may also make
sense to duplicate them into a bigint, and create the bigint on them.
Then you can use AND in your query to test for the 8 bytes (uses index)
and the bytea. Ugly, but may work.

HTH,
Markus

--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org

pgsql-performance by date:

Previous
From: andrew@pillette.com
Date:
Subject: Re: SQL Function Performance
Next
From: Michael Fuhr
Date:
Subject: Re: SQL Function Performance