Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 858 Bytes

README.md

File metadata and controls

19 lines (13 loc) · 858 Bytes

What is this?

Simple experiment to apply database indexing to improve query performance for a hypothetical customer table containing 50 million rows. Partial Index is created on country column, containing two distinct values - 'India' & 'United Kingdom'

Test Environment

  • PostgreSQL 13
  • PgAdmin 4
  • Windows 11 HSL (AMD Ryzen 5)

Results

For the query SELECT * FROM customers WHERE country='United Kingdom';

Using EXPLAIN ANALYZE query for obtaining actual run-time statistics on the required statement before and after indexing.

  • Query Execution Time without index: 41836.270 ms
  • Query Execution Time with index: 24254.644 ms
  • Improvement in query execution time ~42.03%

Related article can be found here.