Re: How to deal with analyze gathering irrelevant stats

2021-01-11 Thread Michael Lewis
On Mon, Jan 11, 2021 at 9:52 AM Rémi Chatenay wrote: > I'd say it's a 1 insert for 5 - 10 updates. > > As for the index on the status, it's because we have a job that runs every > night that deals with conversations in specific statuses. Having a low > cardinality index that changes frequently se

Re: How to deal with analyze gathering irrelevant stats

2021-01-11 Thread Rémi Chatenay
I'd say it's a 1 insert for 5 - 10 updates. As for the index on the status, it's because we have a job that runs every night that deals with conversations in specific statuses. Having a low cardinality index that changes frequently seems prone to mis-use by the system. -> What would be an alterna

Re: How to deal with analyze gathering irrelevant stats

2021-01-11 Thread Michael Lewis
What is the usage pattern of the conversations table? Is getting many inserts during the day, or updates of status mostly? Why have an index on the status column at all? My guess would be that there are 2-10 statuses, but many many rows in the table for most of those statuses. Having a low cardina

Re: How to deal with analyze gathering irrelevant stats

2021-01-11 Thread Adam Brusselback
I'd personally bake an analyze call on that table (column) into whatever job is responsible for changing the state of the table that much, if it's possible to do it as a last step.

Re: How to deal with analyze gathering irrelevant stats

2021-01-11 Thread Justin Pryzby
On Mon, Jan 11, 2021 at 04:50:12PM +0100, Rémi Chatenay wrote: > We are experiencing some slow queries due to the query planner using an > incorrect index. It is using an unoptimized index because the stats are > computed during the night when the data is not the same as during the day. > > CREATE

How to deal with analyze gathering irrelevant stats

2021-01-11 Thread Rémi Chatenay
Hi, Thanks in advance for your help. I'm putting as much context and details as possible, but let me know if you have any questions. What? We are experiencing some slow queries due to the query planner using an incorrect index. It is using an unoptimized index because the stats are computed duri

Re: High COMMIT times

2021-01-11 Thread Don Seiler
On Mon, Jan 11, 2021 at 9:06 AM Craig Jackson wrote: > How far apart are the min/max connection settings on your application > connection pool? We had a similar issue with connection storms in the past > on Oracle. One thing we did to minimize the storms was make sure there was > not a wide gap b

Re: High COMMIT times

2021-01-11 Thread Craig Jackson
How far apart are the min/max connection settings on your application connection pool? We had a similar issue with connection storms in the past on Oracle. One thing we did to minimize the storms was make sure there was not a wide gap between the min/max, say no more than a 5-10 connection differen