optimisation for a table with frequently used query

Поиск
Список
Период
Сортировка
Искать
От
danmcb
Тема
optimisation for a table with frequently used query
Дата
в 16:02:48
Msg-id
1180378837.723695.98800@q75g2000hsh.googlegroups.com
Список
Дерево обсуждения
optimisation for a table with frequently used query danmcb <danielmcbrearty@gmail.com>
Re: optimisation for a table with frequently used query PFC <lists@peufeu.com>
Re: optimisation for a table with frequently used query danmcb <danielmcbrearty@gmail.com>
Re: optimisation for a table with frequently used query Lew <lew@nospam.lewscanon.com>
Re: optimisation for a table with frequently used query "Dann Corbit" <DCorbit@connx.com>
Re: optimisation for a table with frequently used query danmcb <danielmcbrearty@gmail.com>
Re: optimisation for a table with frequently used query PFC <lists@peufeu.com>
Hi,

I have a table that looks like this:

CREATE TABLE my_table {
  id SERIAL PRIMARY KEY,
  id_1 INTEGER REFERENCES tab1(id),
  id_2 INTEGER REFERENCES tab2(id),
  .
  .
  .
};

I will often be running queries that look like

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.

What can I do to help postgres run this query efficiently (if
anything)?

Apologies if this is a "RTFM" question - I looked but did not find.
Could be I didn't look hard enough ...

thanks in advance

Daniel

В списке pgsql-general по дате отправления
От: Poul Møller Hansen
Дата:
Сообщение: Re: Different sort order
От: Greg Quinn
Дата:
FAQ