On Fri, Aug 2, 2013 at 2:58 AM, Sergey Burladyan <eshkinkot@gmail.com> wrote:
>
> PS: I think my main problem is here:
> select min(user_id) from items;
> min
> -----
> 1
> (1 row)
>
> Time: 504.520 ms
That is a long time, but still 100 fold less than the planner is taking.
What about max(user_id)?
>
> also, i cannot reindex it concurrently now, because it run autovacuum: VACUUM ANALYZE public.items (to prevent
wraparound)
That is going to take a long time if you have the cost settings at
their defaults.
Cheers,
Jeff