Re: [GENERAL] - Mailing list pgsql-general

From Alban Hertroys
Subject Re: [GENERAL]
Date
Msg-id CAF-3MvOdE7-BOONaRENQX3mKKuQN__YkG0i5GyBEN_gmKaXzAQ@mail.gmail.com
Whole thread Raw
In response to Re: [GENERAL]  (Yogesh Sharma <yogeshraj95@gmail.com>)
List pgsql-general
On 21 December 2016 at 12:51, Yogesh Sharma <yogeshraj95@gmail.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@gmail.com> wrote:
>>
>> On 21 December 2016 at 09:59, Yogesh Sharma <yogeshraj95@gmail.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.


pgsql-general by date:

Previous
From: Steven Winfield
Date:
Subject: Re: [GENERAL] Request to share approach during REINDEX operation
Next
From: marty kulma
Date:
Subject: [GENERAL] archive_command called for preallocated/recycled WAL?