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
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-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

Browse pgsql-general by date

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

Browse pgsql-performance by date

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