Currently, the number of input tabs we can have in the webapp is limited by the width of the tabs space – it's not possible to have more than about 7-8 tabs because they wouldn't fit on the screen.
One idea to solve this problem is to have a "more..." tab, shown always at the rightmost position, which would show all the inputs emphasizing those that are currently not available on tabs. After the user clicks one of such inputs, the selected input would replace the rightmost regular tab (not the "more..." tab), the new tab would be automatically activated and the cursor placed in the query text field.
In a more sophisticated scenario, each input on the "more..." tab could have a combo box. Entries with the combo box checked would appear as tabs. In this way, users could have as many tabs as they can fit on their screens. One problem with this is the order/ordering of tabs – alphabetical?
Another important factor is to remember user preferences (last added tab, set of selected tabs depending on the scenario) in a persistent cookie.