Skip site navigation (1) Skip section navigation (2)

Re: [GENERAL] select query takes 13 seconds to run with index

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: mark <markkicks(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: [GENERAL] select query takes 13 seconds to run with index
Date: 2008-05-27 14:58:19
Message-ID: 20080527145819.GA7691@depesz.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-performance
On Tue, May 27, 2008 at 07:46:05AM -0700, mark wrote:
> and then it became super fast!! thanks a lot!!!
> my question:
> -> is 500 too high? what all does this affect?

i usually dont go over 100. it affects number of elements in statistics
for fields. you can see the stats in:
select * from pg_stats;

> -> now increasing this number does it affect only when i am running
> analyze commands, or will it slow down inserts and other operations?
> EXPLAIN ANALYZE select * from pokes where uid = 578439028 order by id
> desc limit 6;

it (theoretically) can slow down selects to to the fact that it now has
to load more data to be able to plan (i.e. it loads the statistics, and
since there are more values - the statistics are larger).

generally - in most cases this shouldn't be an issue.

additionally - i think that the 2-column index would work in this
particular case even better.

regards,

depesz

In response to

pgsql-performance by date

Next:From: Simon RiggsDate: 2008-05-27 19:59:18
Subject: Outer joins and equivalence
Previous:From: markDate: 2008-05-27 14:46:05
Subject: Re: [GENERAL] select query takes 13 seconds to run with index

pgsql-general by date

Next:From: Martijn van OosterhoutDate: 2008-05-27 15:08:49
Subject: Re: New MS patent: sounds like PG db rules
Previous:From: Andrew SullivanDate: 2008-05-27 14:52:22
Subject: Re: New MS patent: sounds like PG db rules

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group