Poor database indexing caused 'not found' API queries to take up to 30 seconds

A maritime tracking API was found to be dramatically slower when returning empty results than when returning actual data, a problem traced to misconfigured TimescaleDB compression settings. On September 9, 2026, queries for a vessel's latest port event took 28 milliseconds when data existed but 2 to 2.5 seconds when it did not, while ETA lookups for unmapped vessels could stall for 30 seconds or more. Over a single night, 'not found' requests consumed 71% of all database time spent on the ETA endpoint. The root cause was that compressed data chunks lacked usable indexes on the columns being queried, forcing the database to perform a sequential scan across hundreds of compressed chunks for every miss. Grouping API metrics by route template rather than raw path revealed the pattern, showing that slow responses were consistently tied to empty results rather than specific vessels or endpoints.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in