IDatabase is a massive interface and has more than 140 functions. This goes against software design principles (such as encapsulation or "deep interfaces" concept). As start, we should at least remove barely used functions. A search of function names showed these functions have less than ten search results (there is at least one for the interface, some for the implementations):
[] buildSubString 2
[x] preCommitCallbacksPending 3
- Removed
[x] pendingWriteRowsAffected 3
- Removed
[] wasConnectionLoss 3
[] wasErrorReissuable 3
[] getTopologyRootMaster 4
[] trxTimestamp 4
[] assertNoOpenTransactions 4
[] pendingWriteCallers 4
[x] aggregateValue 4
- Removed
[] bitNot 4
[] bitOr 4
[x] getServerUptime 4
- Removed
[] masterPosWait 4
[] onTransactionIdle 4
[] lockIsFree 4
[] implicitOrderby 5
[] writesPending 5
[] unionConditionPermutations 5
[] wasLockTimeout 5
[] setBigSelects 5
[] getTopologyBasedServerId 6
[] getTopologyRole 6
[] getTopologyRootPrimary 6
[] lastDoneWrites 6
[] writesOrCallbacksPending 6
[] pendingWriteQueryDuration 6
[] buildLeast 6
[] selectDomain 6
[] wasDeadlock 6
[] wasReadOnlyError 6
[] getReplicaPos 6
[] onAtomicSectionCancel 6
[] setSchemaVars 6
[] namedLocksEnqueue 6
[] explicitTrxActive 7
[] dbSchema 7
[] setLBInfo 7
[] restoreFlags 7
[] dataSeek 7
[] buildGreatest 7
[] databasesAreIndependent 7
[] anyChar 7
[] strreplace 7
[] getMasterPos 7
[] serverIsReadOnly 7
[] lastQuery 8
[] numFields 8
[] getSoftwareLink 8
[] primaryPosWait 8
[] flushSnapshot 8
[] getSessionLagStatus 8
[] maxListLen 8
[] setSessionOptions 8
[] decodeExpiry 8
[] setIndexAliases 8
[] getLBInfo 9
[] makeWhereFrom2d 9
[] buildIntegerCast 9
[] selectDB 9
[] deleteJoin 9
[] unionSupportsOrderAndLimit 9
[] setTransactionListener 9
[] encodeExpiry 9
Some might be important and used in critical paths, we can simply mark them as needed. We should generally take a look at how Rdbms is architected and rework that.