On Thu, Dec 9, 2021 at 11:31 AM Greg Wilburn
What's weird is that the same query will use that index sometimes and not others.
When it uses the index, the response time is 1-3 seconds
When it doesn't, the response time is 16-24 seconds
Yeah, this is probably the main thing about query engines which made
me suspicious of them for so long, and kept me relying on hand-coded
RLA. When I was first exposed to query tools on AS/400 (at the time),
query fans assured me that the optimizer was really, really smart. Yet
I would often write queries where I had what I thought was an obvious
logical file to leverage (as an index), and yet the query still ran
dog-slow. Uh, sorry, no, I'll stick to my own SETLL/READ/CHAIN,
I imagine it must have felt something like that for assembly
programmers in the early days of high(ish)-level language compilers.
Today, the combination of hardware that is literally orders of
magnitude faster, plus vastly improved automated optimization, makes
me much more comfortable using SQL whenever that's convenient.
There are still a few corner cases that surprise me (not in a good
way), but sometimes even doing something "the slow way" on today's
machines is Plenty Fast Enough; and there's usually a way to speed
things up yourself if need be. Especially if you have Birgitta-level
As an Amazon Associate we earn from qualifying purchases.