Re: Some question

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: Some question
Дата
Msg-id p2kdcc563d11004061145g928107c0gc73c2b860eee677@mail.gmail.com
обсуждение исходный текст
Ответ на Some question  (Ľubomír Varga <luvar@plaintext.sk>)
Ответы Re: Some question  (Yeb Havinga <yebhavinga@gmail.com>)
Список pgsql-performance
2010/3/31 Ľubomír Varga <luvar@plaintext.sk>:
> Hi, stright to my "problem":
> If I try to select constant 1 from table with two rows, it will be something
> like this:
>
> explain
> SELECT * FROM t_route
>        WHERE t_route.route_type_fk = (SELECT id FROM t_route_type WHERE type = 2)
>        limit 4;
>
> "Limit  (cost=1.02..1.91 rows=4 width=2640)"
> "  InitPlan"
> "    ->  Seq Scan on t_route_type  (cost=0.00..1.02 rows=1 width=8)"
> "          Filter: ("type" = 2)"
> "  ->  Seq Scan on t_route  (cost=0.00..118115.25 rows=535090 width=2640)"
> "        Filter: (route_type_fk = $0)"
>

Looking at this it looks like you're using prepared queries, which
can't make as good of a decision as regular queries because the values
are opaque to the planner.

Can you provide us with the output of explain analyze of that query?

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: LIMIT causes planner to do Index Scan using a less optimal index
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Using high speed swap to improve performance?