Re: Postgres 9 : - How to interpret the EXPLAIN query results

Поиск
Список
Период
Сортировка
От Venkata Balaji N
Тема Re: Postgres 9 : - How to interpret the EXPLAIN query results
Дата
Msg-id CAEyp7J-DgHgAj2tVQ7O9hg7zKVwLLPRGzYbozDxv8vuG0qENrw@mail.gmail.com
обсуждение исходный текст
Ответ на Postgres 9 : - How to interpret the EXPLAIN query results  (Khangelani Gama <kgama@argility.com>)
Ответы Re: Postgres 9 : - How to interpret the EXPLAIN query results
Список pgsql-admin


On Wed, Mar 25, 2015 at 7:00 PM, Khangelani Gama <kgama@argility.com> wrote:

Hi

 

Please help, how can I interpret the following results of my EXPLAIN query ?, I can see that the query will through 18586018 rows, but what’s the meaning of cost and width?

 

GroupAggregate  (cost=762381141.96..768375132.77 rows=18586018 width=32)


cost=762381141.96..768375132.77 means, cost of retrieving the first row is 762381141.96 and the cost of retrieving all the rows is 768375132.77.
rows=18586018 means, expected number of rows as an output.
width=32 means, width of each row scanned/retrieved is 32 bytes.

Cost calculation formula for PostgreSQL is as follows :

cost = (disk pages read * seq_page_cost) + (rows scanned * cpu_tuple_cost)

The above formula may help you analyze/reduce the cost of the query.

If you do an EXPLAIN ANALYZE (sample output is below), that will further help you get more information like query completion time in milli-seconds (actual time), number of rows returned (rows) and how many iterations the query went through to get the output (loop)

 GroupAggregate (cost=xxxx.xx..yyyyy.yy rows=xxxnx width=xx) (actual time=(actual time=xxx.xx rows=xx loops=x)

Thanks,
Venkata Balaji N

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

Предыдущее
От: naveen kumar
Дата:
Сообщение: Re: ERROR: functions in index expression must be marked IMMUTABLE
Следующее
От: Khangelani Gama
Дата:
Сообщение: Re: Postgres 9 : - How to interpret the EXPLAIN query results