Re: 10+hrs vs 15min because of just one index
От | PFC |
---|---|
Тема | Re: 10+hrs vs 15min because of just one index |
Дата | |
Msg-id | op.s4wlqiikcigqcu@apollo13 обсуждение исходный текст |
Ответ на | Re: 10+hrs vs 15min because of just one index (Aaron Turner <synfinatic@gmail.com>) |
Ответы |
Re: 10+hrs vs 15min because of just one index
|
Список | 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 по дате отправления: