Re: Slow query using simple equality operators

From: Benjamin Arai <benjamin(at)araisoft(dot)com>
To: Benjamin Arai <benjamin(at)araisoft(dot)com>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: Slow query using simple equality operators
Date: 2007-04-23 23:48:33
Message-ID: F3244B6B-3700-4362-BCB2-8B28F4EA6395@araisoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

To follow up on my own email, by disabling BitmapScan in my
postgresql.conf the performance seems to be better. Is something
wrong with the query analyzer?

v=# explain select s_content,textdir from text_search where
path_id='1' AND tb_id='P2_TB00001';
QUERY PLAN
------------------------------------------------------------------------
------------------------
Index Scan using idx_search_path_id on text_search
(cost=0.00..4081857.23 rows=5083 width=36)
Index Cond: (path_id = 1)
Filter: (tb_id = 'P2_TB00001'::text)
(3 rows)

Benjamin

On Apr 23, 2007, at 3:38 PM, Benjamin Arai wrote:

> Can anybody explain to me why this query is executing so slow?
>
> =# explain select s_content,textdir from text_search where
> path_id='1' AND tb_id='P2_TB00001';
> QUERY PLAN
> ----------------------------------------------------------------------
> ---------------------------
> Bitmap Heap Scan on text_search (cost=39861.94..59743.55 rows=5083
> width=36)
> Recheck Cond: ((path_id = 1) AND (tb_id = 'P2_TB00001'::text))
> -> BitmapAnd (cost=39861.94..39861.94 rows=5083 width=0)
> -> Bitmap Index Scan on idx_search_path_id
> (cost=0.00..16546.09 rows=1016571 width=0)
> Index Cond: (path_id = 1)
> -> Bitmap Index Scan on idx_search_tb_id
> (cost=0.00..23315.60 rows=1016571 width=0)
> Index Cond: (tb_id = 'P2_TB00001'::text)
> (7 rows)
>
> Thanks in advance!
>
> Benjamin
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-04-24 00:12:53 Re: Slow query using simple equality operators
Previous Message Ketema 2007-04-23 23:20:32 where clause help