Re: 10+hrs vs 15min because of just one index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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.


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux