Re: The query plan get all columns but I'm using only one column.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: The query plan get all columns but I'm using only one column.
Дата
Msg-id 31936.1587824663@sss.pgh.pa.us
обсуждение исходный текст
Ответ на The query plan get all columns but I'm using only one column.  (Moises Lopez <moylop260@vauxoo.com>)
Ответы Re: The query plan get all columns but I'm using only one column.
Список pgsql-performance
Moises Lopez <moylop260@vauxoo.com> writes:
>     ->  Seq Scan on public.link l1  (cost=0.00..10.40 rows=40 width=516)
> (actual time=0.010..0.011 rows=1 loops=1)
> *            Output: l1.id <http://l1.id>, l1.url, l1.name
> <http://l1.name>, l1.description, l1.rel*

This is normal; it is not a bug, and it is not a source of performance
issues either.  The planner is choosing to do that to avoid a projection
step in this plan node, because there's no need for one.  On the other
scan, where it *is* important to project out just the required columns to
minimize the size of the hash table above the scan, it does do so:

>             ->  Seq Scan on public.link l2  (cost=0.00..10.40 rows=40
> width=516) (actual time=0.010..0.011 rows=1 loops=1)
>                 Output: l2.url

> Is there a manner to avoid returning all columns in order to get a better
> performance?

You have not shown us anything about what your actual performance
issue is, but this isn't it.

https://wiki.postgresql.org/wiki/Slow_Query_Questions

            regards, tom lane



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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: PostgreSQL does not choose my indexes well
Следующее
От: Arcadio Ortega Reinoso
Дата:
Сообщение: Re: PostgreSQL does not choose my indexes well