Faster Geospatial Enrichment
tech.marksblogg.com
tech.marksblogg.com
The only actually informative benchmark is to port your application to use each of the the database engines, and then benchmark your application. That will maybe tell you something. Odds are what you were using before has a home field advantage by being fairly well optimized, so even then it doesn't tell you as much as you might believe.
I think you can improve the BigQuery benchmark with a few simple tweaks similar to how you did on Postgres even using on-demand:
- Use CTAS rather than altering (very slow on BQ) - Store the lat,lng as a Geography Point type on ingestion (increases performance significantly vs casting) - Consider spatially clustering the table around the H3 output (wont affect benchmark speed but will make subsequent processing speedy!)
(One also wonders if the column-based database doesn't "cheat" when doing operations of the type "make a new table by adding new columns", since it could in principle COW-reuse all the unchanged columns in memory on that 70-second query.)