Replace list() with set() validation in analyzedb
After testing analyzedb on a huge database with 170k tables we have found a bottleneck while printing candidate list to analyze. It took about 45 minutes to print all tables. The bottleneck was in O(n^2) complexity when we validated candidates in a loop with a list() instead of set(). The same O(n^2) validation is made while running analyze commands on executor pool. This commit change candidate type from list() to set() to reduce complexity from O(n^2) to O(n).
Showing
想要评论请 注册 或 登录