cube2222 / octosql

OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases and file formats using SQL.
Mozilla Public License 2.0
4.76k stars 200 forks source link

Can't use WHERE clause #183

Closed dannyferian closed 4 years ago

dannyferian commented 4 years ago

I tried to run run a query with postgresql config datasource using WHERE clause and got this error image

cube2222 commented 4 years ago

As the error message indicates, it seems like your postgres instance is getting too many connections.

There is an undocumented configuration parameter, lookupJoinPrefetchCount.

You can set it up like this in the config:

execution:
    lookupJoinPrefetchCount: 32
dataSources:
    ...

The default is 32, which in your case of a doubly nested join will create 32*32~900 connections. Could you please try lower values of this parameter? 2,5,10,20?

Please let me know if that helped.

dannyferian commented 4 years ago

does the number will affect the speed when getting data?

cube2222 commented 4 years ago

Yes, it will, if you're joining a big number of rows.

cube2222 commented 4 years ago

Closing this for lack of activity. Feel free to reopen.