Re: Subselect query enhancement

Поиск
Список
Период
Сортировка
От Frank Wiles
Тема Re: Subselect query enhancement
Дата
Msg-id 20070201122045.79ff29c8.frank@wiles.org
обсуждение исходный текст
Ответ на Subselect query enhancement  ("Michael Artz" <mlartz@gmail.com>)
Список pgsql-performance
On Thu, 1 Feb 2007 11:42:03 -0500
"Michael Artz" <mlartz@gmail.com> wrote:

> I'm needing help determining the best all-around query for the
> following situation.  I have primary table that holds ip information
> and two other tables that hold event data for the specific IP in with
> a one-to-many mapping between them, ie:
>
> CREATE TABLE ip_info (
>     ip IP4,
>     --other data
> );
>
> CREATE TABLE network_events (
>     ip IP4 NOT NULL REFERENCES ip_info(ip),
>     name VARCHAR,
>     port INTEGER,
>     --other data
> );
>
> CREATE TABLE host_events (
>     ip IP4 NOT NULL REFERENCES ip_info(ip),
>     name VARCHAR
>     port INTEGER,
>     --other data
> );

It would probably help to have an index on that column for all three
tables, then I would wager using joins will be the speed winner.

 ---------------------------------
   Frank Wiles <frank@wiles.org>
   http://www.wiles.org
 ---------------------------------


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

Предыдущее
От: "Michael Artz"
Дата:
Сообщение: Re: Subselect query enhancement
Следующее
От: "Michael Artz"
Дата:
Сообщение: Re: Subselect query enhancement