Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
To Index or Not to Index: Evaluating Composite B-tree Trade-offs in PostgreSQL OLTP and OLAP Workloads
Blekinge Institute of Technology, Faculty of Computing, Department of Software Engineering.
2025 (English)Independent thesis Basic level (university diploma), 10 credits / 15 HE creditsStudent thesis
Abstract [en]

Indexing is often the first thing that comes to mind when thinking about database optimization. Countless studies have verified the improved performance of indexing on individual queries. However, they often overlook real-world scenarios where indexing must be considered carefully. There are also downsides to adding indexes, namely write penalties caused by the added storage overhead and maintenance of those indexes. This study investigates the trade-offs of B-tree indexing in PostgreSQL, using different workload benchmarks, shining light on what circumstances causes an index to be effective. In addition to empirical findings, this study provides practical guidelines and general takeaways to support developers and database administrators in making informed decisions about when and how to use indexing effectively in real-world scenarios.

Using the benchmarking tool HammerDB, this research evaluates multiple index B-tree composite index configurations across various data sizes, using the TPC-H and TPC-C benchmark. The findings revealed counterintuitively that in both the analytical and transactional workload, adding indexes to the baseline configuration triggered a degradation in performance (even when indexes were adopted by the query planner) across most data sizes.

The TPC-C benchmark revealed that dataset size had a significant impact on the effectiveness of indexes. In the medium-sized datasets (~8-10 GB), both dropping non-essential indexes and adding indexes on read-heavy columns improved performance. This suggests that performance is not all about indexing, memory availability seem to play a vital role in determining the system’s overall performance.

This study demonstrates that indexing relational databases is a complex matter. Quality indexes clearly outperform mass-indexing, even in read-heavy environments. In some circumstances, it is reasonable to consider dropping indexes in order to improve the performance of a system.

Place, publisher, year, edition, pages
2025. , p. 46
Keywords [en]
PostgreSQL, B-tree indexing, HammerDB, TPC-C, TPC-H, OLAP, OLTP, database benchmarking
National Category
Software Engineering
Identifiers
URN: urn:nbn:se:bth-28463OAI: oai:DiVA.org:bth-28463DiVA, id: diva2:1987976
Subject / course
PA1438 Självständigt arbete Webbprogrammering
Educational program
PAGWG Webbprogrammering
Supervisors
Examiners
Available from: 2025-08-18 Created: 2025-08-09 Last updated: 2025-09-30Bibliographically approved

Open Access in DiVA

fulltext(1187 kB)438 downloads
File information
File name FULLTEXT01.pdfFile size 1187 kBChecksum SHA-512
afc9076728bc46a1f95bc37ef49edbaff3b231f2881ff59efc67d312cf7084d97df40df8338c7028af3404eaff01fe3966fb065383ba9afe53176e5e36e98c6e
Type fulltextMimetype application/pdf

By organisation
Department of Software Engineering
Software Engineering

Search outside of DiVA

GoogleGoogle Scholar
Total: 441 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 252 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf