Re: Bitmap scans vs. the statistics views - Mailing list pgsql-hackers

From Jan Wieck
Subject Re: Bitmap scans vs. the statistics views
Date
Msg-id 4269601A.7000400@Yahoo.com
Whole thread Raw
In response to Re: Bitmap scans vs. the statistics views  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Bitmap scans vs. the statistics views
Re: Bitmap scans vs. the statistics views
List 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 #


pgsql-hackers by date:

Previous
From: "Dave Held"
Date:
Subject: Re: Woo hoo ... a whole new set of compiler headaches!! :)
Next
From: Josh Berkus
Date:
Subject: Re: Bitmap scans vs. the statistics views