Re:

From: Alban Hertroys <haramrae(at)gmail(dot)com>
To: Yogesh Sharma <yogeshraj95(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re:
Date: 2016-12-21 14:43:34
Message-ID: CAF-3MvOdE7-BOONaRENQX3mKKuQN__YkG0i5GyBEN_gmKaXzAQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 21 December 2016 at 12:51, Yogesh Sharma <yogeshraj95(at)gmail(dot)com> wrote:
> Dear Alban,
>
> In my production system, there are lot of read write operation performed
> every hour.

That does not explain why you're performing REINDEX on that system;
rather, it explains why you should NOT be performing REINDEX.

VACUUM is what you should be using.

You can VACUUM either using autovacuum with a sufficiently high
frequency that it doesn't fall behind too much,
or by manually running VACUUM ANALYSE on specific tables after batch operations.
Which choice suits you best depends on your workload.

In batches it is often also useful to run (plain) ANALYSE every so
often on the relevant tables to update the statistics, but only when
the batch process is not insert-only.

> So, i am thinking, if i can add check during REINDEX operation nothing
> update and insert operation performed.
> Is it possible?

I have no idea what you're saying.

> On Wednesday, December 21, 2016, Alban Hertroys <haramrae(at)gmail(dot)com> wrote:
>>
>> On 21 December 2016 at 09:59, Yogesh Sharma <yogeshraj95(at)gmail(dot)com> wrote:
>> > Also, every hour,i am performing VACUUM and REINDEX operation on table.
>>
>> Why are you running REINDEX every hour? That's a very unusual thing to
>> do, you'd need a pretty good reason for that.
>>
>> --
>> If you can't see the forest for the trees,
>> Cut the trees and you'll see there is no forest.

--
If you can't see the forest for the trees,
Cut the trees and you'll see there is no forest.

In response to

  • Re: at 2016-12-21 11:51:41 from Yogesh Sharma

Browse pgsql-general by date

  From Date Subject
Next Message marty kulma 2016-12-21 14:53:06 archive_command called for preallocated/recycled WAL?
Previous Message Steven Winfield 2016-12-21 14:16:04 Re: Request to share approach during REINDEX operation