Re: sequence scan problem - Mailing list pgsql-performance

From John Beaver
Subject Re: sequence scan problem
Date
Msg-id 48680AA4.2070800@gmail.com
Whole thread Raw
In response to Re: sequence scan problem  (Jeremy Harris <jgh@wizmail.org>)
List pgsql-performance

Jeremy Harris wrote:
> John Beaver wrote:
>> I'm having a strange problem with a query. The query is fairly
>> simple, with a few constants and two joins. All relevant columns
>> should be indexed, and I'm pretty sure there aren't any type
>> conversion issues. But the query plan includes a fairly heavy seq
>> scan. The only possible complication is that the tables involved are
>> fairly large - hundreds of millions of rows each.
>>
>> Can anyone explain this? There should only ever be a maximum of about
>> 50 rows returned when the query is executed.
>
> You didn't say when you last vacuumed?
I ran 'vacuum analyze' on both tables directly after I finished building
them, and I haven't updated their contents since.
> If there should only be 50 rows returned then the estimates from the
> planner are way out.
>
> If that doesn't help, we'll need version info, and (if you can afford
> the time) an "explain analyze"
Sure, I'm running it now. I'll send the results when it's done, but yes,
it could take a while.
>
> Cheers,
>  Jeremy
>

pgsql-performance by date:

Previous
From: Jeremy Harris
Date:
Subject: Re: sequence scan problem
Next
From: John Beaver
Date:
Subject: Re: sequence scan problem