Re: [PERFORM] Estimation question...

2013-02-28 Thread Matt Daw
/9.0/static/row-estimation-examples.html was a big help. Matt On Wed, Feb 27, 2013 at 9:08 AM, Matt Daw wrote: > Quick follow up... I've found that the row estimate in: > > explain select count(id) from versions where project_id IN (80,115) > A

Re: [PERFORM] Estimation question...

2013-02-27 Thread Matt Daw
ing the same as (project_id=115) on its own. Matt On Tue, Feb 26, 2013 at 11:35 AM, Matt Daw wrote: > Howdy, the query generator in my app sometimes creates redundant > filters of the form: > > project_id IN ( ) AND > project_id = > > ... and this is leading to a bad estimat

[PERFORM] Estimation question...

2013-02-26 Thread Matt Daw
Howdy, the query generator in my app sometimes creates redundant filters of the form: project_id IN ( ) AND project_id = ... and this is leading to a bad estimate (and thus a bad plan) on a few complex queries. I've included simplified examples below. This server is running 9.0.10 and the stati

Re: [PERFORM] Query plan, nested EXISTS

2012-09-28 Thread Matt Daw
((code)::text ~~* '%comp%'::text)) Rows Removed by Filter: 1 Total runtime: 147.411 ms (14 rows) On Fri, Sep 28, 2012 at 2:47 PM, Matt Daw wrote: > Hi Tom, thank you very much. I'll load these tables onto a 9.2 instance > and report back. > >

Re: [PERFORM] Query plan, nested EXISTS

2012-09-28 Thread Matt Daw
Hi Tom, thank you very much. I'll load these tables onto a 9.2 instance and report back. Matt On Fri, Sep 28, 2012 at 2:44 PM, Tom Lane wrote: > Matt Daw writes: > > Howdy, I've been debugging a client's slow query today and I'm curious > > about the q

[PERFORM] Query plan, nested EXISTS

2012-09-28 Thread Matt Daw
Howdy, I've been debugging a client's slow query today and I'm curious about the query plan. It's picking a plan that hashes lots of rows from the versions table (on v9.0.10)... EXPLAIN ANALYZE SELECT COUNT(*) FROM notes a WHERE a.project_id = 114 AND EXISTS ( SELECT 1 FROM note_links b WH

Re: [PERFORM] Performance of Seq Scan from buffer cache

2012-08-21 Thread Matt Daw
ost=0.00..94459.07 rows=1926207 width=0) (actual time=0.005..1475.218 rows=1926207 loops=1) Total runtime: 2889.360 ms (3 rows) Time: 2889.842 ms On Tuesday, 21 August, 2012 at 3:57 PM, Matt Daw wrote: > Howdy. I'm curious what besides raw hardware speed determines the performance

[PERFORM] Performance of Seq Scan from buffer cache

2012-08-21 Thread Matt Daw
Howdy. I'm curious what besides raw hardware speed determines the performance of a Seq Scan that comes entirely out of shared buffers… I ran the following on the client's server I'm profiling, which is otherwise idle: EXPLAIN (ANALYZE ON, BUFFERS ON) SELECT * FROM notes; Seq Scan on notes (cos