Re: Extra cost of "lossy mode" Bitmap Scan plan - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Extra cost of "lossy mode" Bitmap Scan plan
Date
Msg-id 16737.1241703976@sss.pgh.pa.us
Whole thread Raw
In response to Re: Extra cost of "lossy mode" Bitmap Scan plan  (higepon <higepon@gmail.com>)
Responses Re: Extra cost of "lossy mode" Bitmap Scan plan  (higepon <higepon@gmail.com>)
List pgsql-hackers
higepon <higepon@gmail.com> writes:
> But I don't understand this case.
>  select * from emp where emp_no > 10000;
> Is Bitmap Scan is faster than Index Scan in this case ?

Yes, very probably, if a lot of tuples are being retrieved.  A bitmap
scan will fetch the tuples from the heap in a more or less optimal
fashion --- for instance, each page is read only once.  Index scan will
result in a random sequence of accesses to the heap.  (Of course, it
might have some order if the index is well correlated with the heap
order, but most of the time that's not true.)
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Albe Laurenz"
Date:
Subject: Re: Serializable Isolation without blocking
Next
From: Merlin Moncure
Date:
Subject: Re: create if not exists (CINE)