From: Rajesh Kumar Mallah <mallah.rajesh@gmail.com>
To: Yeb Havinga <yebhavinga@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: order by slowing down a query by 80 times
Date: Mon, 28 Jun 2010 19:11:58 +0530
Message-ID: <AANLkTimScoXZXF9Dq797f611P6qi4MRY3SVPshDPLSpK@mail.gmail.com> (raw)
In-Reply-To: <4C2889EF.1050908@gmail.com>
References: <AANLkTim6WXLK8iJuwZbzJjCuPr9LPau1OX7vxwYDFdkN@mail.gmail.com>
<4C2889EF.1050908@gmail.com>
On Mon, Jun 28, 2010 at 5:09 PM, Yeb Havinga <yebhavinga@gmail.com> wrote:
> Rajesh Kumar Mallah wrote:
>
>> Dear List,
>>
>> just by removing the order by co_name reduces the query time dramatically
>> from ~ 9 sec to 63 ms. Can anyone please help.
>>
> The 63 ms query result is probably useless since it returns a limit of 25
> rows from an unordered result. It is not surprising that this is fast.
>
> The pain is here:
>
> Index Scan using profile_master_co_name on profile_master b
> (cost=0.00..1125295.59 rows=6968 width=25) (actual time=0.097..9193.154
> rows=2212 loops=1)
> Filter: ((co_name IS NOT NULL) AND
> ((co_name_vec)::tsvector @@ to_tsquery('manufacturer'::text)))
>
>
> It looks like seq_scans are disabled, since the index scan has only a
> filter expression but not an index cond.
>
seq_scans is NOT explicitly disabled. The two queries just differed in the
order by clause.
regds
Rajesh Kumar Mallah.
>
> regards,
> Yeb Havinga
>
>
>
>> Regds
>> Rajesh Kumar Mallah.
>>
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: mallah.rajesh@gmail.com, yebhavinga@gmail.com
Subject: Re: order by slowing down a query by 80 times
In-Reply-To: <AANLkTimScoXZXF9Dq797f611P6qi4MRY3SVPshDPLSpK@mail.gmail.com>
References: <AANLkTim6WXLK8iJuwZbzJjCuPr9LPau1OX7vxwYDFdkN@mail.gmail.com> <4C2889EF.1050908@gmail.com> <AANLkTimScoXZXF9Dq797f611P6qi4MRY3SVPshDPLSpK@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox