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

From PFC
Subject Re: 10+hrs vs 15min because of just one index
Date
Msg-id op.s4wlqiikcigqcu@apollo13
Whole thread Raw
In response to Re: 10+hrs vs 15min because of just one index  (Aaron Turner <synfinatic@gmail.com>)
Responses Re: 10+hrs vs 15min because of just one index  (Aaron Turner <synfinatic@gmail.com>)
List pgsql-performance
>> Are the key values really all 48 chars long?  If not, you made a
>> bad datatype choice: varchar(n) (or even text) would be a lot
>> smarter.  char(n) wastes space on blank-padding.
>
> Yep, everything exactly 48.   Looks like I'll be storing it as a bytea
> in the near future though.

    It's a good idea not to bloat a column by base64 encoding it if you want
to index it. BYTEA should be your friend.
    If your values are not random, you might want to exploit the correlation.
But if they are already quite uncorrelated, and you don't need the index
for < >, just for =, you can create an index on the md5 of your column and
use it to search. It will use a lot less data but the data will be more
random. With a functional index, you don't need to modify your application
too much.

pgsql-performance by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: SQL Function Performance
Next
From: Markus Schaber
Date:
Subject: Re: help required in design of database