Search Postgresql Archives

Re: Need help requiring uniqueness in text columns

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

 



On 02/01/2008, Matthew Wilson <matt@xxxxxxxxxx> wrote:
> On Wed 02 Jan 2008 04:23:46 AM EST, Pavel Stehule wrote:
> > Hello
> >
> > IDEA 3:
> >
> > Use two hash functions:
> >
> > CREATE UNIQUE INDEX uidx ON TEST((decode(md5(a),'hex')),(hashtext(a)));
> >
> > removing spaces helps
> > CREATE UNIQUE INDEX uidx ON test((decode(md5(lower(replace(a,' ',''))),'hex')));
> >
> > Regards
> > Pavel Stehule
> >
> > CREATE UNIQUE INDEX nodups on MESSAGE (my_timestamp_col, md5(my_text_col));
>
> What is the advantage of this method?
>

much less unique index.

Regards
Pavel

> --
> Programming, economics, gardening, life in Cleveland.
> http://blog.tplus1.com
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org/
>

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
       message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux