Re: Slow inner join, but left join is fast - Mailing list pgsql-performance

From Tom Lane
Subject Re: Slow inner join, but left join is fast
Date
Msg-id 15190.1168456955@sss.pgh.pa.us
Whole thread Raw
In response to Re: Slow inner join, but left join is fast  ("Jeremy Haile" <jhaile@fastmail.fm>)
Responses Re: Slow inner join, but left join is fast  ("Jeremy Haile" <jhaile@fastmail.fm>)
List pgsql-performance
"Jeremy Haile" <jhaile@fastmail.fm> writes:
> Another random idea - does PostgreSQL do any caching of query plans?

Only if the client specifies it, either by PREPARE or the equivalent
protocol-level message.  I dunno what client software you were using,
but I think few if any would PREPARE behind your back.  Might be worth
checking into though, if you've eliminated autovacuum.

Actually there's another possibility --- did you create any indexes on
the table in between?  CREATE INDEX doesn't do a full stats update, but
it does count the rows and update pg_class.reltuples.  But it's hard to
believe that'd have caused as big a rowcount shift as we see here ...

            regards, tom lane

pgsql-performance by date:

Previous
From: "Jeremy Haile"
Date:
Subject: Re: Slow inner join, but left join is fast
Next
From: "Jeremy Haile"
Date:
Subject: Re: Slow inner join, but left join is fast