From: hubert depesz lubaczewski <depesz@depesz.com>
To: mark <markkicks@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: [GENERAL] select query takes 13 seconds to run with index
Date: Tue, 27 May 2008 16:58:19 +0200
Message-ID: <20080527145819.GA7691@depesz.com> (raw)
In-Reply-To: <82fa9e310805270746u56334348m34055cb31219ff45@mail.gmail.com>
References: <82fa9e310805261549m2362fbe8sbf18789938fee833@mail.gmail.com>
<483B4729.7050402@emproshunts.com>
<82fa9e310805261632y46f306fdh84e2da62ffbd7873@mail.gmail.com>
<20080527082201.GA17943@depesz.com>
<82fa9e310805270746u56334348m34055cb31219ff45@mail.gmail.com>
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
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: depesz@depesz.com, markkicks@gmail.com
Subject: Re: [GENERAL] select query takes 13 seconds to run with index
In-Reply-To: <20080527145819.GA7691@depesz.com>
* 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