Fix problems with execution plan building on large queries taking too long
Merge pull request #1491 from systay/faster-plans

Fix problems with execution plan building on large queries taking too long