pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gary Doades <gpd@gpdnet.co.uk>
To: pgsql-performance@postgresql.org
Subject: Re: Optimizing a request
Date: Tue, 31 Aug 2004 21:16:46 +0100
Message-ID: <4134EABE.28891.4E1B76A@localhost> (raw)
In-Reply-To: <4b09a0c04083112425776ec8c@mail.gmail.com>
References: <4134DDDD.428.4AF67CC@localhost>

On 31 Aug 2004 at 21:42, Jean-Max Reymond wrote:

> ----- Original Message -----
> From: Gary Doades <gpd@gpdnet.co.uk>
> Date: Tue, 31 Aug 2004 20:21:49 +0100
> Subject: Re: [PERFORM] Optimizing a request
> To: pgsql-performance@postgresql.org
> 
>  
> 
> > Have you run ANALYZE on this database after creating the indexes or loading the data? 
>  
> the indexes are created and the data loaded and then, I run vacuum analyze.
> 
> >What percentage of rows in the "article" table are likely to match
> the keys selected from  the "rubrique" table?
>  
> only 1 record.
> 
> If it is likely to fetch a high proportion of the rows from article
> then it may be best that a seq scan is performed.
>  
> What are your non-default postgresql.conf settings? It may be better
> to increase the default_statistics_target (to say 100 to 200) before
> running ANALYZE and then re-run the query.
>  
> yes,  default_statistics_target is set to the default_value.
> I have just increased  shared_buffers and effective_cache_size to give
> advantage of 1 Mb RAM
>  

I can only presume you mean 1 GB RAM. What exactly are your 
settings for shared buffers and effective_cache_size?

Can you increase default_statistics_target and re-test? It is possible 
that with such a large table that the distribution of values is skewed and 
postgres does not realise that an index scan would be better.

It seems very odd otherwise that only on row out of 10,000,000 could 
match and postgres does not realise this.

Can you post an explain analyse (not just explain) for this query?

Cheers,
Gary.




view thread (11+ messages)  latest in thread

Message-ID: <4134EABE.28891.4E1B76A@localhost>
Permalink:  ../4134EABE.28891.4E1B76A@localhost/
Also on:    postgresql.org/message-id/4134EABE.28891.4E1B76A@localhost

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: gpd@gpdnet.co.uk
  Subject: Re: Optimizing a request
  In-Reply-To: <4134EABE.28891.4E1B76A@localhost>

* 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