explain doubt

Поиск
Список
Период
Сортировка
От Luca Ferrari
Тема explain doubt
Дата
Msg-id CAKoxK+5PAupy2n4JK9i+ggXSRwnhyfoik7GvqR0Y-afMaUm21g@mail.gmail.com
обсуждение исходный текст
Ответы Re: explain doubt  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi all,
imagine the following simple situation:

# CREATE TABLE test( pk serial not null, description text, primary key(pk));
# INSERT INTO test(pk) VALUES(generate_series(1,1000000 ) );
# VACUUM FULL ANALYZE test;
# EXPLAIN SELECT * FROM test WHERE pk = 1 OR pk = 100;
                                  QUERY PLAN
------------------------------------------------------------------------------
 Bitmap Heap Scan on test  (cost=8.69..16.59 rows=2 width=36)
   Recheck Cond: ((pk = 1) OR (pk = 100))
   ->  BitmapOr  (cost=8.69..8.69 rows=2 width=0)
         ->  Bitmap Index Scan on test_pkey  (cost=0.00..4.35 rows=1
width=0)
               Index Cond: (pk = 1)
         ->  Bitmap Index Scan on test_pkey  (cost=0.00..4.35 rows=1
width=0)
               Index Cond: (pk = 100)

Now, what is the .35 in the cost of the bitmap index scan nodes? I
mean it seems that the system has to walk 23 index tuples on each
index page but I'm not sure about this, does it mean that this is the
tree high? Since the value is the same for both the first and a
"middle" key I suspect it is an average count, but on what?

Thanks

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Help, server doesn't start
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Error message "psql: could not connect to server: No such file or directory"