Title
#users-public
j

Jack

09/30/2022, 8:43 AM
Good morning - quick one, is there a max query length over PG?
8:48 AM
Does this config potentially have impact on it? pg.character.store.capacity 4096 Size of the CharacterStore
Andrey Pechkurov

Andrey Pechkurov

09/30/2022, 8:58 AM
Hi Jack, As far as I can see in the code,
pg.character.store.capacity
defines only initial char buffer size - if the query text is larger than that, the buffer grows.
8:58 AM
Did you face any issues with lengthy queries? What kind of errors did you observe in the server logs?
j

Jack

09/30/2022, 8:58 AM
No real errors - just performance seems to fall off a cliff edge when I run a certain size query
8:59 AM
basically I'm doing a lot of "select * from table where ts in '<DATE>' UNION ALL
8:59 AM
(union all being more performant than doing multiple IN)
8:59 AM
but it seems when I have say, 30-40 union alls, performance drops from sub second to 40s+
9:01 AM
after a certain number of UNION ALLs, it seems that adding 1 more doubles the query time
9:02 AM
22 unions run in about 160ms - if I increase that to 26 we're up to 464ms, increasing again to 30 and we're up to 5.4seconds
Andrey Pechkurov

Andrey Pechkurov

09/30/2022, 9:09 AM
I see. It sounds like something we could check and, probably, optimize. Could you create a GH issue?https://github.com/questdb/questdb/issues/new?assignees=&amp;labels=bug&amp;template=bug_report.yaml
j

Jack

09/30/2022, 9:09 AM
thanks - yep will do, for now I'll split the query out into batches