Re: drawback of array vs join

Поиск
Список
Период
Сортировка
От Emanuel Calvo Franco
Тема Re: drawback of array vs join
Дата
Msg-id f205bb120906231339j1e7e726fm426e8263ec9118fb@mail.gmail.com
обсуждение исходный текст
Ответ на drawback of array vs join  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Ответы Re: drawback of array vs join  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Список pgsql-general
2009/6/23 Ivan Sergio Borgonovo <mail@webthatworks.it>:
> I've a temporary table where I'd like to resume data coming from
> several other tables (normalised the usual way).
> eg.
> a list of items that may belong to several group (eg. item,
> group, itemgroup table) will end up in something similar to:
>
> create temp table itemlisttemp(
>  lid int,
>  iid int,
>  qty int,
>  famid int,
>  rating int,
>  itemgroups int[],
> );
>
> This because I've to loop over the same table several times and
> because it *should* make easier to write dynamic queries [built from
> a web interface] like
>
> select sum(qty) from where
>  famid=3
>  and rating>0
>  and 10 = any itemgroups
> ...
>
> itemlisttemp tables will be very small (30 as an upper limit) and
> arrays as well will contain very few elements (4 as an upper limit).


Which improvement do you want to obtain with the array way?
If the table is very small, the improvement in terms of performance
will be negligible.

--
              Emanuel Calvo Franco
ArPUG [www.arpug.com.ar] / AOSUG Member
        www.emanuelcalvofranco.com.ar

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

Предыдущее
От: Jack Orenstein
Дата:
Сообщение: Query optimizer & prepared statements
Следующее
От: Radcon Entec
Дата:
Сообщение: Controlling proliferation of postgres.exe processes