Re: Speed of locating tables?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Speed of locating tables?
Дата
Msg-id 2447.959358857@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Speed of locating tables?  (Steve Wampler <swampler@noao.edu>)
Список pgsql-general
Steve Wampler <swampler@noao.edu> writes:
> Hmmm, but there's now only one table (with around 2 million rows)
> instead of 100,000 (each with around 20 rows) right?  (I'm confused by
> the "Every table gets...").  I read what you've written as saying "add
> the configuration set ID to each attribute (so now it's an ID, name,
> value triple instead of a pair), storing all attributes for all sets
> in a single table

Right so far.

> and then, when given an ID, search the table,
> collect the matching rows into a temporary table and reference the
> attributes from that temporary table" - is that correct?  [I don't
> need fast update of the attributes, just fast read access while the
> sun is shining.]

There's no particular reason to make a temp table.  As long as you have
an index on the ID column, queries like

    SELECT * FROM configurations WHERE id = 'foo';

will be fast.  This is what DBMSes live to do.

> I imagine I can pull "old" configuration sets from the large table
> (every night, perhaps) and archive them into some other table(s) to
> keep the size of the active table smaller.

If you insist, but it's unlikely to be worth the trouble.

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: "Bryan White"
Дата:
Сообщение: Re: PG 7.0 is 2.5 times slower running a big report
Следующее
От: Barry Lind
Дата:
Сообщение: Re: Speed of locating tables?