Re: Question about index scan vs seq scan when using count()

Поиск
Список
Период
Сортировка
От Kashmira Patel \(kupatel\)
Тема Re: Question about index scan vs seq scan when using count()
Дата
Msg-id 18AE59788A3FC640A367E5652E664D800199BEF9@xmb-sjc-237.amer.cisco.com
обсуждение исходный текст
Ответ на Question about index scan vs seq scan when using count()  ("Kashmira Patel \(kupatel\)" <kupatel@cisco.com>)
Список pgsql-sql
The index has been around since I first created the table. I did VACUUM
ANALYZE, that should have taken care of analyzing this table, right?

-----Original Message-----
From: Tomas Vondra [mailto:tv@fuzzy.cz]
Sent: Thursday, February 23, 2006 2:29 PM
To: Kashmira Patel (kupatel)
Subject: Re: [SQL] Question about index scan vs seq scan when using
count()

> What am I doing wrong here? I want it to use my index.

For small tables the sequential scan is faster, that means less disk
reads is required the whole table than to use the index.

If it is a large table, the index should be used. Have you created the
index recently? Have you analyzed the table since that time (ANALYZE
tablename)

t.v.


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

Предыдущее
От: "Kashmira Patel \(kupatel\)"
Дата:
Сообщение: Re: Question about index scan vs seq scan when using count()
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: Question about index scan vs seq scan when using count()