Re: [PERFORM] Unused indices

2011-02-24 Thread Shaun Thomas
On 02/24/2011 12:13 PM, Greg Smith wrote: That's not quite the right filter. You want to screen out everything that isn't a unique index, not just the primary key ones. You probably can't drop any of those without impacting database integrity. Ah yes. I was considering adding the clause for u

Re: [PERFORM] Unused indices

2011-02-24 Thread Greg Smith
Shaun Thomas wrote: I noticed with our database that without the indisprimary clause, we had another 4GB of unused indexes. That's not quite the right filter. You want to screen out everything that isn't a unique index, not just the primary key ones. You probably can't drop any of those wit

Re: [PERFORM] Unused indices

2011-02-24 Thread Shaun Thomas
On 02/23/2011 03:17 PM, Greg Smith wrote: Yes. The block usage you're seeing there reflects the activity from maintaining the index. But since it isn't ever being used for queries, with zero scans and zero rows it's delivered to clients, Nice to know. To that end, here's a query that will find

Re: [PERFORM] Unused indices

2011-02-23 Thread Greg Smith
Benjamin Krajmalnik wrote: Index Scans0 Index Tuples Read 0 Index Tuples Fetched0 Index Blocks Read 834389 Index Blocks Hit247283300 Index Size 1752 kB Since there are no in

[PERFORM] Unused indices

2011-02-23 Thread Benjamin Krajmalnik
I am trying to clean up our schema by removing any indices which are not being used frequently or at all. Using pgadmin, looking at the statistics for an index, I see various pieces of information: Index Scans, Index Tuples Read, Index Tuples Fetched, Index Blocks Read, and Index Blocks Hit.