Re: Beginner Question

From: "Dave Dutcher" <dave(at)tridecap(dot)com>
To: "'s d'" <s(dot)d(dot)sauron(at)gmail(dot)com>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Beginner Question
Date: 2007-04-10 14:11:57
Message-ID: 012801c77b7a$33b49e10$2e00a8c0@tridecap.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

In your first post you said that the query is taking much longer than a
second, and in your second post you say the performance is horrible, but
explain analyze shows the query runs in 219 milliseconds, which doesn't seem
too bad to me. I wonder if the slow part for you is returning all the rows
to the client? How are you running this query? (JDBC, ODBC, C library?)
Do you really need all the rows? Maybe you could use a cursor to page
through the rows?

Dave

> -----Original Message-----
> From: pgsql-performance-owner(at)postgresql(dot)org
> [mailto:pgsql-performance-owner(at)postgresql(dot)org] On Behalf Of s d
> Sent: Monday, April 09, 2007 7:46 PM
> To: Jan de Visser
> Cc: pgsql-performance(at)postgresql(dot)org
> Subject: Re: [PERFORM] Beginner Question
>
>
> Hi Jan,
> Adding this Index slowed down things by a factor of 4.
>
> Also, the performance is so horrible (example bellow) that i am
> certain i am doing something wrong.
>
> Does the following explain gives any ideas ?
>
> Thanks
>
> =# EXPLAIN ANALYZE select * from word_association where (word1 ='the'
> or word2='the') and count > 10;
>
> QUERY PLAN
> --------------------------------------------------------------
> --------------------------------------------------------------
> --------------------
> Bitmap Heap Scan on word_association (cost=250.86..7256.59 rows=4624
> width=22) (actual time=13.461..211.568 rows=6601 loops=1)
> Recheck Cond: (((word1)::text = 'the'::text) OR ((word2)::text =
> 'the'::text))
> Filter: (count > 10)
> -> BitmapOr (cost=250.86..250.86 rows=12243 width=0) (actual
> time=9.052..9.052 rows=0 loops=1)
> -> Bitmap Index Scan on word_association_index1_1
> (cost=0.00..153.20 rows=7579 width=0) (actual time=5.786..5.786
> rows=7232 loops=1)
> Index Cond: ((word1)::text = 'the'::text)
> -> Bitmap Index Scan on word_association_index2_1
> (cost=0.00..95.34 rows=4664 width=0) (actual time=3.253..3.253
> rows=4073 loops=1)
> Index Cond: ((word2)::text = 'the'::text)
> Total runtime: 219.987 ms
> (9 rows)

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Drew Wilson 2007-04-10 15:37:31 Re: how to efficiently update tuple in many-to-many relationship?
Previous Message Tom Lane 2007-04-10 13:54:02 Re: how to efficiently update tuple in many-to-many relationship?