Performance Benchmarks
PostgreSQL is the gold standard of relational databases — battle-tested over 40 years, trusted by millions of deployments worldwide, and renowned for its reliability and query performance. We use PostgreSQL as our benchmark because that is the standard we hold ourselves to. Our goal is to learn from the best and make InventDB better with every release.
Below are side-by-side query performance measurements for InventDB and PostgreSQL across 143 queries in 18 categories. All times are warm-run totals in milliseconds (lower is faster). Tests were conducted on the same hardware under identical conditions.
Test Environment
Database Configuration
| Parameter | InventDB | PostgreSQL |
|---|---|---|
| Storage Model | Segmented B-Link tree (100K records/segment) | Standard heap + B-tree indexes |
| Encryption | AES-256-GCM at rest | None |
| Page Cache | Disabled (page_cache = 0) | shared_buffers ~4 GB |
| Document Cache | Disabled | N/A |
| Aggregate Cache | Disabled | N/A |
| Data Types | 4 types: Customer, CustomerContact, CustomerDevice, CustomerInteraction | |
10 Million Records (Equal Scale)
Both databases loaded with 2,500,000 records per type (10M total). Identical data, identical queries.
| Metric | InventDB | PostgreSQL |
|---|---|---|
| Total Records | 10,000,000 | 10,000,000 |
| Records per Type | 2,500,000 | 2,500,000 |
| Segments per Type | 25 | Single table |
| Insert Throughput | 18,941 rec/s | 15,197 rec/s |
Category Totals
Single-Threaded (ST)
143 queries, cold + warm run each. Times = category warm totals (ms).
| Category | InventDB | PostgreSQL |
|---|---|---|
| Basic SELECT (7) | 53 | 1,702 |
| Exact Match (7) | 87 | 7 |
| Range (11) | 76 | 7 |
| LIKE (8) | 484 | 54 |
| Compound WHERE (12) | 702 | 14 |
| ORDER BY (12) | 123 | 8,324 |
| GROUP BY (14) | 634 | 7,334 |
| GROUP BY + WHERE (4) | 16 | 1,902 |
| JOIN 2-table (12) | 4,141 | 16,354 |
| JOIN 3-table (11) | 13,035 | 63,948 |
| JOIN 4-table (5) | 2,003 | 38,981 |
| Secondary Table (9) | 83 | 1,399 |
| Pagination (6) | 110 | 422 |
| NULL Handling (2) | 72 | 250 |
| HAVING (4) | 237 | 3,742 |
| Edge Case (8) | 5 | 725 |
| Complex (5) | 3,598 | 13,238 |
| DISTINCT (6) | 359 | 5,885 |
| Total Warm | 25,818 | 164,288 |
| Total Cold | 88,316 | 181,053 |
| Wall Clock | 115.9s | 380.2s |
Multi-Threaded (4 Threads)
143 queries × 4 threads. Times = per-thread avg warm totals (ms).
| Category | InventDB | PostgreSQL |
|---|---|---|
| Basic SELECT (7) | 39 | 5,430 |
| Exact Match (7) | 240 | 6 |
| Range (11) | 200 | 6 |
| LIKE (8) | 220 | 89 |
| Compound WHERE (12) | 946 | 11 |
| ORDER BY (12) | 262 | 23,339 |
| GROUP BY (14) | 1,239 | 26,108 |
| GROUP BY + WHERE (4) | 18 | 5,533 |
| JOIN 2-table (12) | 6,921 | 48,805 |
| JOIN 3-table (11) | 19,070 | 220,444 |
| JOIN 4-table (5) | 5,341 | 158,815 |
| Secondary Table (9) | 82 | 3,161 |
| Pagination (6) | 178 | 1,194 |
| NULL Handling (2) | 19 | 740 |
| HAVING (4) | 427 | 10,093 |
| Edge Case (8) | 176 | 2,401 |
| Complex (5) | 7,610 | 30,463 |
| DISTINCT (6) | 1,114 | 13,995 |
| Per-Thread Warm | 44,102 | 550,633 |
| Per-Thread Cold | 109,201 | 617,293 |
| Wall Clock | 154.2s | 1,281.7s |
Per-Query Statistics
Distribution of individual query execution times across all 143 queries. All times in milliseconds.
Single-Threaded (143 queries)
| Metric | Cold (ms) | Warm (ms) | ||
|---|---|---|---|---|
| InventDB | PG | InventDB | PG | |
| Average | 617 | 1,257 | 181 | 1,149 |
| Median (p50) | 135 | 5 | 10 | 4 |
| p90 | 1,712 | 2,390 | 367 | 3,474 |
| p95 | 2,978 | 7,515 | 1,365 | 7,503 |
| p99 | 7,155 | 19,734 | 2,428 | 20,011 |
| Max | 10,932 | 23,764 | 2,439 | 22,837 |
Multi-Threaded (4 threads)
| Metric | Cold (ms) | Warm (ms) | ||
|---|---|---|---|---|
| InventDB | PG | InventDB | PG | |
| Average | 735 | 3,950 | 294 | 3,850 |
| Median (p50) | 136 | 11 | 20 | 5 |
| p90 | 2,428 | 10,486 | 682 | 8,727 |
| p95 | 4,166 | 14,486 | 2,220 | 17,722 |
| p99 | 7,378 | 76,671 | 3,461 | 71,579 |
| Max | 11,110 | 93,705 | 4,221 | 95,819 |
Both databases: 143 queries × 4 threads, all concurrent (identical contention model). PG GROUP BY excludes query 7.14.
Query Time Distribution (Single-Threaded Warm)
How many queries fall into each latency bucket, and which categories they belong to. Based on 136 comparable warm-run queries at equal 10M scale.
InventDB v0.27
| Latency Bucket | Queries | % of Total | Bucket Sum | Categories |
|---|---|---|---|---|
| 0 – 10 ms | 79 | 55% | 318 ms | ORDER BY (12), GROUP BY (10), Edge Case (8), Range (11), Basic SELECT (6), Secondary Table (7), Exact Match (7), GROUP BY+WHERE (4), LIKE (3), JOIN 2-table (3), HAVING (2), Pagination (2), DISTINCT (2), NULL Handling (1), Compound WHERE (1) |
| 11 – 50 ms | 21 | 15% | 388 ms | Compound WHERE (6), Pagination (3), Secondary Table (2), Basic SELECT (1), HAVING (1), LIKE (1), GROUP BY (1), Compound WHERE (1), JOIN 2-table (1), JOIN 3-table (1), Complex (1), DISTINCT (1), NULL Handling (1) |
| 51 – 100 ms | 6 | 4% | 467 ms | LIKE (3), Compound WHERE (1), NULL Handling (1), Compound WHERE (1) |
| 101 – 500 ms | 27 | 19% | 6,393 ms | JOIN 2-table (5), JOIN 4-table (5), JOIN 3-table (4), GROUP BY (3), Complex (3), LIKE (2), Compound WHERE (2), HAVING (1), DISTINCT (1), Pagination (1) |
| 501 – 1,000 ms | 1 | 1% | 671 ms | Complex (1) |
| 1,000+ ms | 9 | 6% | 15,977 ms | JOIN 3-table (6), JOIN 2-table (2), Complex (1) |
PostgreSQL 18.2
| Latency Bucket | Queries | % of Total | Bucket Sum | Categories |
|---|---|---|---|---|
| 0 – 10 ms | 78 | 55% | 88 ms | Compound WHERE (12), Range (11), ORDER BY (10), LIKE (7), Exact Match (7), Edge Case (6), JOIN 2-table (5), Secondary Table (6), Pagination (5), Basic SELECT (3), JOIN 3-table (3), Complex (1), JOIN 4-table (1), NULL Handling (1) |
| 11 – 50 ms | 1 | 1% | 32 ms | LIKE (1) |
| 51 – 100 ms | 2 | 1% | 135 ms | JOIN 3-table (1), JOIN 2-table (1) |
| 101 – 500 ms | 24 | 17% | 9,182 ms | GROUP BY (10), DISTINCT (4), Basic SELECT (4), Secondary Table (2), HAVING (1), Pagination (1), NULL Handling (1), Edge Case (1) |
| 501 – 1,000 ms | 16 | 11% | 9,091 ms | GROUP BY (4), HAVING (3), DISTINCT (2), ORDER BY (2), JOIN 2-table (2), Secondary Table (1), Complex (1), Edge Case (1) |
| 1,000+ ms | 22 | 15% | 145,760 ms | JOIN 3-table (7), JOIN 2-table (4), JOIN 4-table (4), GROUP BY+WHERE (4), Complex (3) |
Key Observations (10M)
- Sub-10ms tier: InventDB places 79 queries (55%) under 10ms vs PostgreSQL's 78 (55%). InventDB's per-property B-trees now match PostgreSQL's page cache for point queries and range scans with LIMIT.
- Sub-50ms tier: InventDB places 100 queries (70%) under 50ms vs PostgreSQL's 79 (55%). InventDB's per-property B-trees and count trees keep ORDER BY, GROUP BY, and DISTINCT queries fast.
- Tail latency (1s+): InventDB has 9 queries (6%) over 1 second totaling 16s. PostgreSQL has 22 queries (15%) over 1 second totaling 146s. InventDB's hash-based JOIN aggregation is faster for GROUP BY and COUNT(DISTINCT) across tables.
Query Time Distribution (Multi-Threaded, 4 Threads, Warm)
How many queries fall into each latency bucket under 4-thread contention. Both databases at equal 10M scale (2.5M/type). Times are per-thread average warm values across 143 queries.
InventDB v0.27
| Latency Bucket | Queries | % of Total | Bucket Sum | Categories |
|---|---|---|---|---|
| 0 – 10 ms | 38 | 27% | 111 ms | GROUP BY (9), Basic SELECT (6), Edge Case (6), GROUP BY+WHERE (4), JOIN 2-table (3), Secondary Table (3), Pagination (2), HAVING (2), Compound WHERE (1), NULL Handling (1), DISTINCT (1) |
| 11 – 50 ms | 62 | 43% | 1,386 ms | ORDER BY (12), Exact Match (7), Range (11), Compound WHERE (5), Secondary Table (6), LIKE (5), Distinct (3), GROUP BY (3), Pagination (3), Basic SELECT (1), JOIN 2-table (1), JOIN 3-table (1), HAVING (1), Edge Case (2), NULL Handling (1) |
| 51 – 100 ms | 6 | 4% | 408 ms | LIKE (2), Compound WHERE (2), Pagination (1), Edge Case (1) |
| 101 – 500 ms | 16 | 11% | 4,539 ms | JOIN 2-table (4), Compound WHERE (3), GROUP BY (2), Complex (2), JOIN 3-table (1), Pagination (1), HAVING (1), Distinct (1), LIKE (1) |
| 501 – 1,000 ms | 8 | 6% | 5,416 ms | JOIN 3-table (2), GROUP BY (1), JOIN 4-table (2), JOIN 2-table (1), Complex (1), Distinct (1) |
| 1,000+ ms | 13 | 9% | 30,217 ms | JOIN 3-table (6), JOIN 4-table (3), Complex (2), JOIN 2-table (2) |
PostgreSQL 18.2
| Latency Bucket | Queries | % of Total | Bucket Sum | Categories |
|---|---|---|---|---|
| 0 – 10 ms | 75 | 52% | 77 ms | Compound WHERE (12), Range (11), ORDER BY (10), Exact Match (7), LIKE (7), Secondary Table (6), Edge Case (6), Pagination (5), JOIN 2-table (4), Basic SELECT (2), JOIN 3-table (2), JOIN 4-table (1), NULL Handling (1), Complex (1) |
| 11 – 50 ms | 3 | 2% | 62 ms | LIKE (1), JOIN 3-table (1), Complex (1) |
| 51 – 100 ms | 2 | 1% | 118 ms | JOIN 2-table (1), Edge Case (1) |
| 101 – 500 ms | 3 | 2% | 722 ms | ORDER BY (1), JOIN 4-table (1), Secondary Table (1) |
| 501 – 1,000 ms | 3 | 2% | 2,312 ms | Edge Case (1), Pagination (1), NULL Handling (1) |
| 1,000+ ms | 57 | 40% | 547,342 ms | GROUP BY (14), JOIN 3-table (8), JOIN 2-table (7), DISTINCT (6), Basic SELECT (5), GROUP BY+WHERE (4), HAVING (4), JOIN 4-table (3), Complex (3), ORDER BY (1), Secondary Table (2) |
Key Observations (10M MT)
- Sub-50ms tier: InventDB places 100 queries (70%) under 50ms vs PostgreSQL’s 78 (55%). Under contention, InventDB’s lockless per-property B-trees maintain low latency across ORDER BY, GROUP BY, and Range queries.
- Sub-1s tier: InventDB keeps 130 queries (91%) under 1 second vs PostgreSQL’s 86 (60%). PostgreSQL’s full-table scans for GROUP BY and aggregation queries degrade sharply under contention.
- Tail latency (1s+): InventDB has 13 queries (9%) over 1 second totaling 30s. PostgreSQL has 57 queries (40%) over 1 second totaling 547s — 18× more total tail time.
Data Ingestion Performance
Detailed breakdown of the time to load 10,000,000 records (2.5M per type × 4 types) into each database.
InventDB
| Phase | Time |
|---|---|
| Batch Insert (all 10M records) | 527.95s |
| Total | 527.95s |
| Effective Throughput | 18,941 rec/s |
All indexes built inline during insert. Data encrypted (AES-256) on write. No post-insert index build or analysis needed.
PostgreSQL
| Phase | Time |
|---|---|
| COPY (bulk load, unlogged tables) | 47.7s |
| Index Creation (B-tree on all columns) | 208.4s |
| Foreign Key Constraints | 8.8s |
| SET LOGGED (enable WAL) | 354.4s |
| ANALYZE (statistics update) | 12.9s |
| Total | 658.1s |
| Effective Throughput | 15,197 rec/s |
Raw COPY throughput: 209,471 rec/s. Total includes all post-load operations required for production readiness (indexes, constraints, WAL, statistics).
100 Million Records (Equal Scale)
Both databases loaded with 25,000,000 records per type (100M total). Identical data, identical queries. Multi-threaded benchmark: 4 threads, each running all 143 queries independently (worst-case contention).
| Metric | InventDB | PostgreSQL |
|---|---|---|
| Total Records | 100,000,000 | 100,000,000 |
| Records per Type | 25,000,000 | 25,000,000 |
| Segments per Type | 250 | Single table |
Category Totals
Single-Threaded (ST)
Both at 25M/type (100M). 143 queries, cold + warm run each. Times = category warm totals (ms).
| Category | InventDB | PostgreSQL |
|---|---|---|
| Basic SELECT (7) | 53 | 11,201 |
| Exact Match (7) | 75 | 20 |
| Range (11) | 79 | 18 |
| LIKE (8) | 515 | 30 |
| Compound WHERE (12) | 1,101 | 23 |
| ORDER BY (12) | 488 | 91,195 |
| GROUP BY (14) | 6,210 | 64,023 |
| GROUP BY + WHERE (4) | 175 | 16,510 |
| JOIN 2-table (12) | 57,405 | 400,509 |
| JOIN 3-table (11) | 181,804 | 1,483,001 |
| JOIN 4-table (5) | 22,525 | 932,276 |
| Secondary Table (9) | 191 | 12,290 |
| Pagination (6) | 452 | 3,946 |
| NULL Handling (2) | 108 | 2,108 |
| HAVING (4) | 2,257 | 104,487 |
| Edge Case (8) | 34 | 6,733 |
| Complex (5) | 106,415 | 341,894 |
| DISTINCT (6) | 3,818 | 58,414 |
| Total Warm | 383,705 | 3,528,678 |
| Total Cold | 1,717,944 | 4,194,721 |
| Wall Clock | 36.3 min | 133.9 min |
Multi-Threaded (4 Threads, Equal Scale)
Both at 25M/type (100M). 143 queries × 4 threads. Times = per-thread avg warm totals (ms).
| Category | InventDB | PostgreSQL |
|---|---|---|
| Basic SELECT (7) | 61 | 49,576 |
| Exact Match (7) | 201 | 25 |
| Range (11) | 245 | 19 |
| LIKE (8) | 254 | 49 |
| Compound WHERE (12) | 2,147 | 33 |
| ORDER BY (12) | 1,132 | 266,867 |
| GROUP BY (14) | 37,371 | 252,294 |
| GROUP BY + WHERE (4) | 232 | 61,599 |
| JOIN 2-table (12) | 170,680 | 1,476,743 |
| JOIN 3-table (11) | 329,031 | 4,740,037 |
| JOIN 4-table (5) | 58,499 | 4,539,029 |
| Secondary Table (9) | 232 | 489,524 |
| Pagination (6) | 956 | 93,817 |
| NULL Handling (2) | 116 | 110,332 |
| HAVING (4) | 12,034 | 639,116 |
| Edge Case (8) | 51 | 74,083 |
| Complex (5) | 218,852 | 1,131,351 |
| DISTINCT (6) | 7,371 | 397,762 |
| Per-Thread Warm | 839,464 | 14,322,256 |
| Per-Thread Cold | 2,578,426 | 15,539,728 |
| Wall Clock | 57.1 min | 512.8 min |
Per-Query Statistics
Distribution of individual query execution times across all 143 queries. Both databases at equal 100M scale (25M/type). All times in milliseconds.
Single-Threaded (143 queries)
| Metric | Cold (ms) | Warm (ms) | ||
|---|---|---|---|---|
| InventDB | PG | InventDB | PG | |
| Average | 13,060 | 29,130 | 2,967 | 24,676 |
| Median (p50) | 291 | 9 | 26 | 8 |
| p90 | 35,573 | 77,540 | 4,376 | 78,253 |
| p95 | 81,876 | 163,653 | 21,265 | 166,776 |
| p99 | 228,621 | 335,093 | 79,670 | 335,929 |
| Max | 300,535 | 448,034 | 85,582 | 440,885 |
Both at 25M/type (100M). PG query 7.14 excluded.
Multi-Threaded (143 queries, equal 100M, warm)
| Metric | Warm (ms) | |
|---|---|---|
| InventDB | PG | |
| Average | 5,939 | 100,155 |
| Median (p50) | 37 | 17 |
| p90 | 12,348 | 283,610 |
| p95 | 31,806 | 527,609 |
| p99 | 147,432 | 1,432,238 |
| Max | 193,355 | 1,938,575 |
Both at 25M/type (100M). Per-thread average across 4 threads, each running all 143 queries.
Query Time Distribution (Single-Threaded Warm)
How many queries fall into each latency bucket. Based on 143 warm-run queries at equal 100M scale (25M/type).
InventDB v0.27
| Latency Bucket | Queries | % of Total | Bucket Sum | Categories |
|---|---|---|---|---|
| 0 – 10 ms | 57 | 40% | 281 ms | Range (11), GROUP BY (8), Edge Case (7), Basic SELECT (6), Secondary Table (5), Exact Match (5), LIKE (3), JOIN 2-table (3), Distinct (2), GROUP BY+WHERE (2), HAVING (1), Compound WHERE (1), NULL Handling (1), Pagination (1), ORDER BY (1) |
| 11 – 50 ms | 30 | 21% | 869 ms | ORDER BY (8), Compound WHERE (5), Secondary Table (4), Exact Match (2), GROUP BY+WHERE (2), Pagination (2), LIKE (2), Distinct (2), Basic SELECT (1), Edge Case (1), GROUP BY (1) |
| 51 – 100 ms | 14 | 10% | 938 ms | LIKE (3), Compound WHERE (3), ORDER BY (3), Compound WHERE (2), Pagination (1), NULL Handling (1), GROUP BY (1) |
| 101 – 500 ms | 8 | 6% | 2,127 ms | Compound WHERE (2), LIKE (2), Pagination (1), Distinct (1), GROUP BY (1), HAVING (1) |
| 501 – 1,000 ms | 1 | 1% | 579 ms | HAVING (1) |
| 1,000+ ms | 33 | 23% | 419,500 ms | JOIN 3-table (10), JOIN 2-table (8), JOIN 4-table (5), Complex (5), GROUP BY (3), HAVING (1), Distinct (1) |
PostgreSQL 18.2
| Latency Bucket | Queries | % of Total | Bucket Sum | Categories |
|---|---|---|---|---|
| 0 – 10 ms | 74 | 52% | 90 ms | Compound WHERE (12), Range (11), ORDER BY (10), LIKE (8), Exact Match (7), Edge Case (6), Secondary Table (5), Pagination (5), JOIN 2-table (3), Basic SELECT (2), JOIN 3-table (2), Complex (1), NULL Handling (1), JOIN 4-table (1) |
| 11 – 50 ms | 0 | 0% | — | — |
| 51 – 100 ms | 0 | 0% | — | — |
| 101 – 500 ms | 4 | 3% | 800 ms | JOIN 2-table (2), JOIN 3-table (1), Complex (1) |
| 501 – 1,000 ms | 2 | 1% | 1,208 ms | Basic SELECT (1), Secondary Table (1) |
| 1,000+ ms | 63 | 44% | 3,526,555 ms | GROUP BY (14), JOIN 3-table (8), JOIN 2-table (7), DISTINCT (6), GROUP BY+WHERE (4), HAVING (4), Complex (3), JOIN 4-table (4), Basic SELECT (4), Secondary Table (3), Edge Case (2), Pagination (1), NULL Handling (1), ORDER BY (2) |
Key Observations (100M)
- ST headline: At equal 100M scale (both 25M/type), InventDB completes 143 warm queries in 431s (7.2 min) vs PostgreSQL’s 3,529s (58.8 min) — InventDB 8.2× faster.
- MT headline: Under 4-thread contention, InventDB completes in 945s per thread (15.7 min) vs PostgreSQL’s 14,322s per thread (239 min) — InventDB 15.2× faster.
- InventDB wins 14 of 18 categories in both ST and MT. PostgreSQL wins only 4 indexed point-lookup categories (Exact Match, Range, LIKE, Compound WHERE) where its page cache provides sub-millisecond response.
- Contention resilience: InventDB degrades only 2.2× from ST to MT, while PostgreSQL degrades 4.1×. This transforms InventDB’s 8.2× ST advantage into a 15.2× MT advantage.
- Biggest gaps: JOIN 4-table queries: InventDB 67s vs PG 4,539s under MT (67× faster). Secondary Table: InventDB 235ms vs PG 490s (2,083×). NULL Handling: InventDB 152ms vs PG 110s (726×).
Query Time Distribution (Multi-Threaded, 4 Threads, Warm)
How many queries fall into each latency bucket under 4-thread contention. Both databases at equal 100M scale (25M/type). Times are per-thread average warm values across 143 queries.
InventDB v0.27
| Latency Bucket | Queries | % of Total | Bucket Sum | Categories |
|---|---|---|---|---|
| 0 – 10 ms | 19 | 13% | 67 ms | Edge Case (6), Basic SELECT (5), JOIN 2-table (3), Secondary Table (2), NULL Handling (1), HAVING (1), Compound WHERE (1) |
| 11 – 50 ms | 56 | 39% | 1,281 ms | Range (11), Exact Match (7), LIKE (7), GROUP BY (5), Compound WHERE (4), Secondary Table (5), Basic SELECT (2), GROUP BY+WHERE (3), Pagination (2), Distinct (3), HAVING (1), Edge Case (2), ORDER BY (2), NULL Handling (1), Pagination (1) |
| 51 – 100 ms | 11 | 8% | 844 ms | ORDER BY (4), GROUP BY+WHERE (1), Compound WHERE (2), GROUP BY (1), LIKE (1), Compound WHERE (1), Secondary Table (1) |
| 101 – 500 ms | 19 | 13% | 3,157 ms | ORDER BY (6), Compound WHERE (3), Pagination (3), Distinct (3), JOIN 2-table (1), JOIN 3-table (1), LIKE (1), Secondary Table (1) |
| 501 – 1,000 ms | 1 | 1% | 573 ms | Pagination (1) |
| 1,000+ ms | 37 | 26% | 843,382 ms | JOIN 3-table (10), JOIN 2-table (8), JOIN 4-table (5), Complex (5), GROUP BY (4), HAVING (2), Compound WHERE (1), Distinct (2) |
PostgreSQL 18.2
| Latency Bucket | Queries | % of Total | Bucket Sum | Categories |
|---|---|---|---|---|
| 0 – 10 ms | 67 | 47% | 95 ms | Range (11), Compound WHERE (11), ORDER BY (9), Exact Match (7), LIKE (6), Edge Case (5), JOIN 2-table (4), Secondary Table (4), Pagination (4), Basic SELECT (2), JOIN 3-table (2), JOIN 4-table (1), Complex (1) |
| 11 – 50 ms | 8 | 6% | 132 ms | LIKE (2), Compound WHERE (1), ORDER BY (1), Pagination (1), NULL Handling (1), Edge Case (1), Secondary Table (1) |
| 51 – 100 ms | 0 | 0% | — | — |
| 101 – 500 ms | 2 | 1% | 336 ms | JOIN 2-table (1), Secondary Table (1) |
| 501 – 1,000 ms | 2 | 1% | 1,424 ms | JOIN 2-table (1), JOIN 3-table (1) |
| 1,000+ ms | 64 | 45% | 14,320,309 ms | GROUP BY (14), JOIN 3-table (8), JOIN 2-table (6), DISTINCT (6), Basic SELECT (5), GROUP BY+WHERE (4), JOIN 4-table (4), HAVING (4), Complex (4), Secondary Table (3), ORDER BY (2), Edge Case (2), Pagination (1), NULL Handling (1) |
Key Observations (100M MT)
- Contention resilience: InventDB degrades 2.2× from ST to MT (431s → 945s). PostgreSQL degrades 4.1× (3,529s → 14,322s). InventDB’s segment-based architecture provides natural isolation under concurrent load.
- Massive gaps at scale: Under MT contention, InventDB’s JOIN 4-table (67s) vs PostgreSQL’s (4,539s) shows a 67× gap. Secondary Table: InventDB 235ms vs PG 490s (2,083×). NULL Handling: InventDB 152ms vs PG 110s (726×).
- Tail latency: InventDB confines its heavy queries to multi-table JOINs and Complex queries. PostgreSQL’s tail spreads across nearly every category — even Basic SELECT (COUNT) takes ~50s under MT contention at 100M.
Methodology
Query Suite
143 queries across 18 categories covering: basic SELECT, exact match, range, LIKE, compound WHERE, ORDER BY, GROUP BY (with and without WHERE), 2/3/4-table JOINs, secondary table queries, pagination, NULL handling, HAVING, edge cases, complex multi-stage operations, and DISTINCT. PostgreSQL includes one additional query (7.14: GROUP BY first_name, last_name) excluded from comparisons.
Measurement
- Cold run: First execution after database open (no warm caches).
- Warm run: Second execution immediately after cold (OS page cache warm).
- ST mode: One query at a time, sequential execution.
- MT mode: Both databases run all queries on each of 4 threads simultaneously (worst-case contention). Each thread executes all 143 queries independently with cold + warm runs.
Data Generation
Both databases use the same schema and data generation logic. Customer records include FirstName, LastName, Age, Salary, DateOfBirth, Email, FullName, and nested Address fields (Street, City, State, PostalCode). Related types (Contact, Device, Interaction) are linked via CustomerId.
Differences to Note
- InventDB operates with AES-256 encryption at rest; PostgreSQL operates unencrypted.
- InventDB runs with all application-level caches disabled; PostgreSQL uses ~4 GB shared_buffers.
- 10M test: equal scale (2.5M/type each). 100M test: equal scale (25M/type each).
- MT contention model: both databases run all 143 queries on each of 4 threads simultaneously (worst-case contention).
Benchmark History
Performance progression across InventDB releases. PostgreSQL baseline (18.2) is unchanged across all versions. All tests run with InventDB caches disabled and AES-256 encryption active.
| Version | Date | Config | 10M ST Overall | 10M MT Overall | 100M ST Overall | 100M MT Overall |
|---|---|---|---|---|---|---|
| v0.6 | 2026-03-05 | All caches disabled | 5.1× faster | 12.1× faster | 6.9× faster | 17.1× faster |
| v0.9b | 2026-03-11 | All caches disabled | 6.0× faster | 12.5× faster | 9.3× faster | 16.5× faster |
| v0.9c | 2026-03-13 | All caches disabled | 6.0× faster | 11.7× faster | 8.0× faster | 16.4× faster |
| v0.12 | 2026-03-14 | All caches disabled | 6.4× faster | 12.1× faster | 8.1× faster | 15.7× faster |
| v0.15 | 2026-03-15 | All caches disabled | 6.1× faster | 12.0× faster | 8.0× faster | 17.0× faster |
| v0.21 | 2026-03-16 | All caches disabled | 6.3× faster | 11.9× faster | 9.2× faster | 16.7× faster |
| v0.21 | 2026-03-17 | All caches disabled | 6.3× faster | 12.1× faster | 8.8× faster | 17.8× faster |
| v0.24 | 2026-03-18 | All caches disabled | 6.7× faster | 13.0× faster | 8.3× faster | 16.8× faster |
| v0.27 | 2026-03-19 | All caches disabled | 6.4× faster | 12.5× faster | 9.2× faster | 17.1× faster |