Re: Unused indexes

2024-02-06 Thread Ron Johnson
reset from pg_stat_database; > > to see when/if they were reset. You can look for zero/low entries in > pg_stat_user_indexes.idx_scan to find unused indexes. Note that replicas > maintain their own stats, so checking only the primary may cause a false > positive. > > >> I sql server

Re: Unused indexes

2024-02-05 Thread Greg Sabino Mullane
/low entries in pg_stat_user_indexes.idx_scan to find unused indexes. Note that replicas maintain their own stats, so checking only the primary may cause a false positive. > I sql server we have this option to disable it and need to rebuild it to >> ensemble it >> > > Sadly, PG does

Re: Unused indexes

2024-02-05 Thread Ron Johnson
On Mon, Feb 5, 2024 at 9:02 AM arun chirappurath wrote: > Hi All, > > Do we have a script to get unused indexes for 30 days and once identified > do we have an option to disable and enable when required? > The pg_stat_*_tables tables idx_* columns has accumulated usage since th

Unused indexes

2024-02-05 Thread arun chirappurath
Hi All, Do we have a script to get unused indexes for 30 days and once identified do we have an option to disable and enable when required? I sql server we have this option to disable it and need to rebuild it to ensemble it Thanks, Arun

Re: Unused indexes

2018-12-01 Thread Martín Marqués
El sáb., 1 dic. 2018 a las 8:24, Ron () escribió: > > For indexes that existed before the cluster was last started, and for which > REINDEX hasn't been run on them since the cluster was last started... is it > valid to say that an index has not been used since the cluster was started > if these

Re: Unused indexes

2018-12-01 Thread Rene Romero Benavides
I think your assumption is correct, as long as the statistics collector is working correctly (I've never seen this not being the case), and the setting "track_counts" is set to on. Am Sa., 1. Dez. 2018 um 05:24 Uhr schrieb Ron : > For indexes that existed before the cluster was last started, and

Unused indexes

2018-12-01 Thread Ron
For indexes that existed before the cluster was last started, and for which REINDEX hasn't been run on them since the cluster was last started... is it valid to say that an index has not been used since the cluster was started if these three pg_stat_all_indexes fields all have a value of 0?