Re: why is bitmap index chosen for this query? - Mailing list pgsql-performance

From Jim C. Nasby
Subject Re: why is bitmap index chosen for this query?
Date
Msg-id 20060519205915.GO64371@pervasive.com
Whole thread Raw
In response to Re: why is bitmap index chosen for this query?  (Stephen Byers <stephenabyers@yahoo.com>)
List 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 by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Performance/Maintenance test result collection
Next
From: "Cstdenis"
Date:
Subject: How can I make this query faster (resend)