Re: optimisation for a table with frequently used query

From: PFC <lists(at)peufeu(dot)com>
To: danmcb <danielmcbrearty(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: optimisation for a table with frequently used query
Date: 2007-05-28 19:37:11
Message-ID: op.ts1x39bmcigqcu@apollo13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> SELECT * from my_table where id_1 = x and id_2 = y;
>
> Neither id_1 or id_2 or the combination of them is unique. I expect
> this table to become large over time.

Create an index on (id_1, id_2), or (id_2,id_1).

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2007-05-28 20:00:46 Re: createdb.exe prompting for password on Vista
Previous Message Greg Quinn 2007-05-28 19:13:20 Re: createdb.exe prompting for password on Vista