Re: quick question abt pg_dump and restore

Поиск
Список
Период
Сортировка
От Andreas Kretschmer
Тема Re: quick question abt pg_dump and restore
Дата
Msg-id 20080109165626.GA21376@KanotixBox
обсуждение исходный текст
Ответ на Re: quick question abt pg_dump and restore  ("Josh Harrison" <joshques@gmail.com>)
Ответы Re: quick question abt pg_dump and restore  ("Josh Harrison" <joshques@gmail.com>)
Список pgsql-general
Josh Harrison <joshques@gmail.com> schrieb:
> My questions
> 1.  I pg_dumped dummy and Shuffled_dummy (from database1) to another database
> (database2)
> When I issued the query in both database (database1 and database2)
>
> select * from dummy limit 1000 ( the planner chooses seq scan for this query)
> select * from shuffled_dummy limit 1000 (planner chooses seq scan)
>
>
> 2. Also when does the planner switch from choosing index scan to bitmap index
> scan? Is it dependent on the number of rows to be retrieved or the position of
> the relevant data in the blocks or something else?

For a select * ... without a WHERE the db can't use an index, this query
forced a seq-scan.

A index is used when:
- a index are created
- a propper WHERE or ORDER BY in the query
- this index is useful
  (a index isn't useful, for instance, for a small table or when almost
  all rows are in the result set)

A bitmap index scan performed when:
- 2 or more propper indexes available
- see above



Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."    (unknow)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

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

Предыдущее
От: "Josh Harrison"
Дата:
Сообщение: Re: quick question abt pg_dump and restore
Следующее
От: "Scott Marlowe"
Дата:
Сообщение: Re: count(*) and bad design was: Experiences with extensibility