From: | "Rushabh Lathia" <rushabh(dot)lathia(at)gmail(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Cc: | rushabh(dot)lathia(at)enterprisedb(dot)com |
Subject: | Re: Problem with Bitmap Heap Scan |
Date: | 2008-11-19 11:08:59 |
Message-ID: | 460abcb10811190308n3dd06e4ei957d57a34746cbbe@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Analysis:
========
While debugging bitmap heap scan (BitmapHeapNext function) found that first
we perform the underlying index scan and then iterate over bitmap. Now while
iterating, we execute ExecQual only if tbmres->recheck is true. And for the
query tbmres->recheck is false.
But from the query it seems that we should execute ExecQual as we having
"bitmpaqual" on the BitmapHeap node (Not quite sure). And when I manually
did recheck = ture, query working fine and as expected.
Regards.
Rushabh
www.EnterpriseDB.com
On Wed, Nov 19, 2008 at 4:26 PM, Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>wrote:
> Simple select give wrong result when it uses the Bitmap Heap Scan path.
>
>
> postgres=# CREATE OR REPLACE FUNCTION my_exec_im_test_func(i integer)
> RETURNS integer AS $$
> BEGIN
> RETURN i + 1;
> END;
> $$ LANGUAGE plpgsql;
> CREATE FUNCTION
>
> postgres=# set enable_seqscan=off;
> SET
> postgres=# set enable_indexscan=off;
> SET
> postgres=# select proname from pg_proc where proname like 'my_pro1';
> proname
> ----------------------
> my_exec_im_test_proc
> (1 row)
>
> postgres=# explain select proname from pg_proc where proname like
> 'my_pro1';
> QUERY
> PLAN
>
>
> --------------------------------------------------------------------------------
> -------------
> Bitmap Heap Scan on pg_proc (cost=4.26..8.27 rows=1 width=64)
> Recheck Cond: (proname ~~ 'my_pro1'::text)
> -> Bitmap Index Scan on pg_proc_proname_args_nsp_index
> (cost=0.00..4.26 row
> s=1 width=0)
> Index Cond: ((proname >= 'my'::name) AND (proname < 'mz'::name))
> (4 rows)
>
>
>
>
> --
> Rushabh Lathia
>
> www.EnterpriseDB.com
--
Rushabh Lathia
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2008-11-19 13:36:29 | Re: [COMMITTERS] pgsql: Rethink the way FSM truncation works. |
Previous Message | Rushabh Lathia | 2008-11-19 10:56:44 | Problem with Bitmap Heap Scan |