Re: why is bitmap index chosen for this query?

Поиск
Список
Период
Сортировка
От Jim C. Nasby
Тема Re: why is bitmap index chosen for this query?
Дата
Msg-id 20060519205915.GO64371@pervasive.com
обсуждение исходный текст
Ответ на Re: why is bitmap index chosen for this query?  (Stephen Byers <stephenabyers@yahoo.com>)
Список pgsql-performance
On Thu, May 18, 2006 at 12:38:18PM -0700, Stephen Byers wrote:
> I repeated explain analyze on the query 5 times and it came up with the same plan.
>
> You asked about index order and physical table order.  In general the index order is indeed close to the same order
asthe physical table order.  However, this query is likely an exception.  The data is actually from a backup server
thathas filled a hole for some of the time range that I'm specifying in my query. 

What's SELECT correlation FROM pg_stats WHERE tablename='packets' AND
attname='environment_name' show?

What's effective_cache_size and random_page_cost set to?

Also, out of curiosity, why not just use a timestamp instead of two
int's  for storing time?

>   Wow -- so what does that mean?  Do I need to leave my work_mem at 100MB??  I mentioned that my application actually
usesa cursor to walk through this data.  Even though the bitmap scan technically had the fastest time with explain
analyze,it takes a long while (20 seconds) before the results start to come back through the cursor.  Conversely, with
theindex scan, results immediately come back through the cursor method (which is more desirable).  Thoughts?   

Do you really need to use a cursor? It's generally less efficient than
doing things with a single SQL statement, depending on what exactly
you're doing.
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

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

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: Performance/Maintenance test result collection
Следующее
От: "Cstdenis"
Дата:
Сообщение: How can I make this query faster (resend)