Re: Bitmap scans vs. the statistics views

Jan Wieck <janwieck@yahoo.com>

From: Jan Wieck <JanWieck@Yahoo.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: josh@agliodbs.com, pgsql-hackers@postgresql.org
Date: 2005-04-22T20:35:38Z
Lists: pgsql-hackers
On 4/22/2005 3:53 PM, Tom Lane wrote:

> Jan Wieck <JanWieck@Yahoo.com> writes:
>> tuples fetched is the number of raw, possibly dead tuples fetched from 
>> the heap. Tuples returned is the number of alive tuples ... IIRC.
> 
> No, count_heap_fetch only counts tuples that have already passed the
> snapshot test.  It could be that the places where the counts are
> actually bumped don't line up with your original vision for the
> stats design.
> 
> For a regular index scan, it seems to make sense to count (a) number of
> TIDs returned by the index AM, and (b) number of tuples returned by the
> IndexScan node.  There are several intermediate steps
> 	* does the tuple pass the snapshot test
> 	* does the tuple pass any indexqual rechecks (for lossy indexes)
> 	* does the tuple pass any additional non-index restriction
> 	  conditions that are being enforced at the scan level

Now that you say it ... yes. The whole stats stuff was intended 
originally to find "DB tuning hints". A large number of tuples returned 
by index scan and filtered out by additional non-index restrictions 
indicate that there might be another multicolumn index missing.


Jan

-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #