Re: Working with huge amount of data.

From: Jonathan Ballet <jon(at)multani(dot)info>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Working with huge amount of data.
Date: 2008-02-11 16:43:43
Message-ID: 47B07B3F.9030204@multani.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Mario Lopez wrote:
> Hi guys :-), I am working on a personal project in which I am trying to
> make sense on a huge (at least for me) amount of data. I have
> approximately 150 million rows of unique words (they are not exactly
> words it is just for explaining the situation).
>
> The table I am inserting this is a quite simple table, something like this:
>
> CREATE TABLE "public"."names" (
> "id" SERIAL,
> "name" VARCHAR(255)
> ) WITHOUT OIDS;
>
> It is a requirement that I can make searches on the varchar with queries
> that look the following way:
>
> SELECT * FROM names WHERE name LIKE ‘keyword%’
> Or
> SELECT * FROM names WHERE name LIKE ‘%keyword%’
>
> I optimized the first type of queries making partitions with every
> letter that a name can begin with:

AFAIK, you only need to add an index on "name" to be able to speed up the first kind of queries.
Have a look at B-Tree description in [1].

- Jonathan

[1] : http://www.postgresql.org/docs/8.3/interactive/indexes-types.html

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dave Page 2008-02-11 16:44:43 Re: ERROR: expected just one rule action
Previous Message INDIANNIC-HOSTING 2008-02-11 16:43:12 INDIANNIC : POSTGRES WINDOWS INSTALLATION