Skip to main content
Skip to main content

Performance Comparison

Choose the optimal backend for your dataset size and performance requirements. This guide provides detailed benchmarks and recommendations to help you make informed decisions.

Quick Recommendation
  • < 10k features: Any backend works well
  • 10k - 50k features: Spatialite optimal, PostgreSQL if available
  • 50k - 500k features: PostgreSQL recommended (5-10x faster)
  • > 500k features: PostgreSQL required

Performance by Dataset Size​

Visual Decision Matrix​

Benchmark Results​

Test Environment​

All benchmarks performed on:

  • CPU: Intel Core i7-10700K (8 cores, 3.8GHz)
  • RAM: 16GB DDR4
  • Storage: NVMe SSD (Samsung 970 EVO)
  • OS: Ubuntu 22.04 LTS
  • QGIS: 3.34 LTR
  • PostgreSQL: 14.10 with PostGIS 3.3
  • Python: 3.10

Overall Performance Summary​

Dataset SizePostgreSQLSpatialiteOGR (GeoPackage)OGR (Shapefile)Recommendation
< 10k0.5s ⚑0.5s ⚑0.8s ⚑1.2s ⚑Any backend
10k - 50k1.2s ⚑2.1s ⚑5.3s 🐌8.7s 🐌Spatialite
50k - 100k2.1s ⚑8.5s 🐌15.2s 🐌25.1s 🐌PostgreSQL
100k - 500k8.4s ⚑65s 🐌108s 🐌187s 🐌PostgreSQL
> 500k45s ⚑Timeout ❌Timeout ❌Timeout ❌PostgreSQL only

Legend:

  • ⚑ Excellent (< 10s)
  • 🐌 Slow (> 10s)
  • ❌ Not viable (timeout/crash)

Detailed Benchmarks by Operation​

Simple Intersects Query​

Dataset: 100,000 polygon features
Filter: 1,000 features
Operation: ST_Intersects(geometry, filter_geometry)

BackendExecution TimeFeatures ReturnedMemory Usage
PostgreSQL2.1s8,34745 MB
Spatialite8.5s8,347128 MB
OGR (GeoPackage)15.2s8,347512 MB
OGR (Shapefile)25.1s8,347712 MB

Analysis:

  • PostgreSQL is 4x faster than Spatialite
  • PostgreSQL is 7x faster than OGR GeoPackage
  • PostgreSQL uses 11x less memory than OGR Shapefile

Buffer + Intersects​

Dataset: 50,000 line features
Buffer: 100 meters
Operation: ST_Intersects(geometry, ST_Buffer(filter_geometry, 100))

BackendBuffer TimeIntersect TimeTotal TimeSpeedup
PostgreSQL0.3s0.9s1.2s7x
Spatialite1.2s6.5s7.7s1.1x
OGR (GeoPackage)3.1s5.2s8.3s1x (baseline)
OGR (Shapefile)4.7s8.9s13.6s0.6x

Analysis:

  • PostgreSQL server-side buffering is 10x faster than client-side
  • Spatialite matches OGR for small buffers
  • Shapefile format adds significant overhead

Complex Expression​

Dataset: 200,000 point features
Expression: ST_Intersects() AND distance < 500 AND area > 1000

BackendQuery PlanningExecutionTotalIndex Usage
PostgreSQL0.2s3.1s3.3sβœ… GIST + B-tree
Spatialite-18.3s18.3sβœ… R-tree
OGR (GeoPackage)-45.7s45.7sβœ… R-tree
OGR (Shapefile)-123s123s⚠️ .qix only

Analysis:

  • PostgreSQL query planner optimizes multi-condition queries
  • Combined spatial + attribute indexes only in PostgreSQL
  • OGR backends must evaluate all conditions sequentially

Real-World Scenarios​

Scenario 1: Urban Planning (Parcels)​

Data: 75,000 cadastral parcels
Task: Find all parcels intersecting a proposed development zone
Filter: 15 complex polygons

BackendInitial LoadFilter ApplyRefreshUser Experience
PostgreSQL0.8s1.5s0.3s⚑ Instant
Spatialite1.2s12.1s11.8s🐌 Noticeable delay
OGR (GeoPackage)2.3s23.4s22.9s🐌 Significant wait

Recommendation: PostgreSQL for professional use

Scenario 2: Environmental Analysis (Points)​

Data: 15,000 measurement points
Task: Find points within 200m of contamination sites
Filter: 50 point locations with 200m buffer

BackendBuffer CreationSpatial QueryTotalRecommendation
PostgreSQL0.1s0.4s0.5sβœ… Excellent
Spatialite0.3s1.8s2.1sβœ… Good
OGR (GeoPackage)0.8s4.2s5.0s⚠️ Acceptable

Recommendation: Spatialite sufficient for this size

Scenario 3: Infrastructure Network (Lines)​

Data: 350,000 road segments
Task: Find all roads crossing flood zones
Filter: 500 flood polygons

BackendResultNotes
PostgreSQL15.2s ⚑Excellent, usable
Spatialite187s 🐌Very slow, not practical
OGRTimeout ❌Not viable

Recommendation: PostgreSQL required

Performance Factors​

1. Dataset Size Impact​

PostgreSQL scales linearly with excellent performance:

Features:     10k    50k    100k   500k   1M     5M
Time: 0.5s 1.2s 2.1s 8.4s 45s 180s
Per-feature: 50ΞΌs 24ΞΌs 21ΞΌs 17ΞΌs 45ΞΌs 36ΞΌs

Spatialite performance degrades with size:

Features:     10k    50k    100k   500k   1M
Time: 0.5s 2.1s 8.5s 65s Timeout
Per-feature: 50ΞΌs 42ΞΌs 85ΞΌs 130ΞΌs -

OGR severely limited by size:

Features:     10k    50k    100k   500k
Time: 0.8s 5.3s 15.2s Timeout
Per-feature: 80ΞΌs 106ΞΌs 152ΞΌs -

2. Spatial Index Impact​

With Spatial Index:

BackendIndex Type100k FeaturesSpeedup
PostgreSQLGIST2.1s100x
SpatialiteR-tree8.5s50x
OGR (GeoPackage)R-tree15.2s30x
OGR (Shapefile).qix25.1s15x

Without Spatial Index:

Backend100k Featuresvs Indexed
PostgreSQL210s100x slower ❌
Spatialite425s50x slower ❌
OGR (GeoPackage)456s30x slower ❌
OGR (Shapefile)376s15x slower ❌
Critical

Always ensure spatial indexes exist! They provide 15-100x performance improvement.

3. Geometry Complexity​

Simple Geometries (Points, simple polygons):

Backend100k Simple100k ComplexRatio
PostgreSQL2.1s3.8s1.8x
Spatialite8.5s18.2s2.1x
OGR15.2s41.7s2.7x

Complex Geometries (Multi-part, many vertices):

  • Increase processing time 2-3x
  • More pronounced impact on OGR backend
  • PostgreSQL handles complexity best

4. Concurrent Operations​

5 Simultaneous Filters:

BackendSequentialConcurrentSpeedup
PostgreSQL10.5s3.2s3.3x faster βœ…
Spatialite42.5s38.1s1.1x faster
OGR76s91s1.2x slower ❌

Analysis:

  • PostgreSQL excels at concurrent operations
  • Spatialite handles concurrency acceptably
  • OGR suffers from memory layer contention

Memory Usage Comparison​

Peak Memory Consumption​

Dataset: 100,000 features

BackendLoadingFilteringPeak TotalEfficiency
PostgreSQL25 MB20 MB45 MB⚑ Excellent
Spatialite45 MB83 MB128 MBβœ… Good
OGR (Memory)156 MB356 MB512 MB⚠️ High
OGR (Shapefile)178 MB534 MB712 MB❌ Very high

Memory Scaling​

PostgreSQL (MB per 100k features):

100k β†’ 45 MB
500k β†’ 127 MB
1M β†’ 234 MB
5M β†’ 1.1 GB

Spatialite (MB per 100k features):

100k β†’ 128 MB
500k β†’ 612 MB
1M β†’ 1.4 GB (may crash)

OGR (MB per 100k features):

100k β†’ 512 MB
500k β†’ 3.2 GB (likely crash)

Network Performance (PostgreSQL)​

Local vs Remote Database​

Dataset: 100,000 features

ConnectionQuery TimeData TransferTotalvs Local
Local (localhost)2.1s-2.1s1x
LAN (1 Gbps)2.3s0.2s2.5s1.2x
WAN (100 Mbps)2.4s1.8s4.2s2x
Remote (10 Mbps)2.5s18.3s20.8s10x

Recommendations:

  • Local PostgreSQL: Best performance
  • LAN connection: Minimal impact
  • WAN/Remote: Consider VPN optimization or data sync

Cost-Benefit Analysis​

Setup Time Investment​

BackendInitial SetupLearning CurveMaintenanceBest For
PostgreSQL30-60 minModerateLowLarge datasets, production
Spatialite0 minEasyNoneSmall-medium datasets
OGR0 minVery easyNoneTesting, prototypes

Performance ROI​

For 100k features, 10 operations/day:

BackendDaily Time LostWeeklyMonthlyAnnual
PostgreSQL21s2.5 min11 min2.2 hours
Spatialite85s10 min42 min8.5 hours
OGR152s18 min76 min15.2 hours

PostgreSQL saves:

  • 1 minute vs Spatialite per operation
  • 2 minutes vs OGR per operation
  • 13 hours per year for typical usage
Investment Worth It?

If you filter > 100k features more than once per week, PostgreSQL setup time pays for itself in 1 month.

Decision Matrix​

Choose PostgreSQL When​

βœ… Dataset > 50,000 features
βœ… Need best performance
βœ… Server infrastructure available
βœ… Concurrent users
βœ… Professional/production use
βœ… Complex spatial operations
βœ… Frequent filtering (> 5 times/day)

Choose Spatialite When​

βœ… Dataset 10,000 - 50,000 features
βœ… No database server available
βœ… Portable solution needed
βœ… Quick setup required
βœ… Single user
βœ… Occasional filtering (< 5 times/day)
βœ… Desktop/laptop use

Choose OGR When​

βœ… Dataset < 10,000 features
βœ… Format compatibility critical
βœ… Testing/prototyping
βœ… One-time operations
βœ… No setup time available
βœ… Rare filtering (< 1 time/day)

Optimization Recommendations​

For Maximum Performance​

  1. Use PostgreSQL for datasets > 50k
  2. Ensure spatial indexes exist and are up-to-date
  3. Run VACUUM ANALYZE regularly (PostgreSQL/Spatialite)
  4. Increase cache sizes in database configuration
  5. Use SSD storage for databases
  6. Optimize geometry complexity if possible
  7. Batch operations when multiple filters needed

For Balanced Approach​

  1. Start with Spatialite for prototyping
  2. Migrate to PostgreSQL when needed
  3. Create spatial indexes always
  4. Monitor performance with EXPLAIN
  5. Test with representative data before production

Troubleshooting Slow Performance​

Performance Checklist​

  • Spatial index exists and is valid
  • Database statistics up-to-date (ANALYZE)
  • Sufficient RAM available
  • SSD storage (not HDD)
  • Network connection fast (if remote DB)
  • QGIS version up-to-date
  • No other heavy processes running
  • Geometry not excessively complex

Diagnostic Queries​

PostgreSQL:

-- Check query plan
EXPLAIN ANALYZE
SELECT * FROM layer WHERE ST_Intersects(geometry, filter_geom);

-- Look for "Index Scan using" not "Seq Scan"

-- Check index usage
SELECT schemaname, tablename, indexname, idx_scan
FROM pg_stat_user_indexes
WHERE tablename = 'my_layer';

Spatialite:

-- Check if index exists
SELECT * FROM geometry_columns WHERE f_table_name = 'my_layer';

-- Check index
SELECT * FROM sqlite_master WHERE type = 'table' AND name LIKE 'idx_%';

See Also​


Benchmarks Last Updated: December 8, 2025
Plugin Version: 2.2.3
Test Dataset: OpenStreetMap data, typical GIS workloads