ANALYZE updates PostgreSQL table statistics so the query planner can reconsider available indexes and choose more effective execution plans. section 4.5.1
Refresh statistics after creating an index
After creating an index, refresh the table statistics: CREATE INDEX on tableA(columnB); ANALYZE tableA; For the player statistics table, ANALYZE helps PostgreSQL recognize the new score index. EXPLAIN can then verify whether queries use an Index Only Scan or Index Scan.

