GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Connecting to the sql-api is an expensive operation, doing it twice for every mapconfig creation is a bottleneck.
The reason why this was done as two distinct queries was because the "affectedTables" one was likely to be cached in Varnish (if in use), but given that the configuration might choose a direct connection instead... it isn't a good optimization.
I've just found out that a call to "lastUpdated" is made even when the list of affected tables is empty. That's just lame :)
With f24e4f8 there is no "lastUpdated" call if query is affected by no tables.
This was implemented in 3af45e1