Re: Performance woes relating to DISTINCT (I think) - Mailing list pgsql-general

From Jim C. Nasby
Subject Re: Performance woes relating to DISTINCT (I think)
Date
Msg-id 20050929204900.GM30974@pervasive.com
Whole thread Raw
In response to Re: Performance woes relating to DISTINCT (I think)  (boinger <boinger@gmail.com>)
List pgsql-general
On Tue, Sep 27, 2005 at 09:07:41AM -0500, boinger wrote:
>               ->  Index Scan using strafe_group on tasks_applied
> (cost=0.00..6.02 rows=1 width=22) (actual time=0.042..0.043 rows=0
> loops=1188)
>
>                     Index Cond: ((("outer".modcode)::text =
> (tasks_applied.modcode)::text) AND (tasks_applied.yearcode =
> "outer".yearcode) AND (tasks_applied.seid = 500001))
>
>                     Filter: (cid = 0)
>
> Total runtime: 80.764 ms

Compare that to the index scan it had to do before. Now that you gave
the database the exact info it needs to answer your real question, it
can use a much, much more selective index scan.
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

pgsql-general by date:

Previous
From: Vivek Khera
Date:
Subject: Re: DBI/DBD::Pg mem. use goes exponential
Next
From: "Jim C. Nasby"
Date:
Subject: Re: [SQL] add column if doesn't exist (fwd)