We could make use of getTables() call that we're already doing anyway to check whether there is an index on the incremental column. And if not, maybe emit a message. It should not fail because of it, but it should be immediately visible that this might be the problem.
there is a MAX() query to make things faster when using timestamp that needs to be converted from binary
the MAX() query exploits that fact that this should be super fast if indexed
even if it's not indexed, it does not need to transfer the big bunch of data to our server and all the calculations are local to the SQL server - transfering massive amounts of data seemed to be a root cause of some of the problems in db-exes
Ref.: https://keboola.slack.com/archives/C035LGNK5/p1566907933002000?thread_ts=1566832565.002900&cid=C035LGNK5
We could make use of getTables() call that we're already doing anyway to check whether there is an index on the incremental column. And if not, maybe emit a message. It should not fail because of it, but it should be immediately visible that this might be the problem.