Title
#users-public
s

Sam Shiles

10/24/2022, 2:06 PM
Quick question. Is it possible to run multiple sql statements at the same time using the web console? It sort of looks like it works as the status bar at the bottom show both statements, however only one is actually executed.
Pei

Pei

10/24/2022, 3:51 PM
Hi Sam, afaik it’s not possible to execute two queries at the same time, so the status might be a bug there. (It seems like it’s showing whatever you selected even tho it only executed the first one).
3:52 PM
@arijus correct me if i’m wrong here. 🙂
Arijus Šukys

Arijus Šukys

10/24/2022, 4:22 PM
Hey @Sam Shiles 👋 Thank you for sharing a screen recording!
Is it possible to run multiple sql statements at the same time using the web console? It sort of looks like it works as the status bar at the bottom show both statements, however only one is actually executed.
No, it is not possible to run multiple queries at once. The web console uses REST interface to communicate with QuestDB. When you select query with your mouse, the content of that selection is sent to QuestDB via
/exec
endpoint. In this case, your selection includes two queries, and they are separated with a semicolon, which is a SQL statement terminator. Therefore, even though QuestDB receives the whole selected text (both queries), it only considers the query until first semicolon. You can confirm this behaviour by looking at QuestDB logs. For example, let's say we select and run these queries:
select x from long_sequence(2);
select x from long_sequence(3);
Below is a truncated version of what you would see in QuestDB logs:
exec [q='select x from long_sequence(2); select x from long_sequence(3);']
...
plan [q=`select-choose x from (select [x] from long_sequence(2))`, fd=90]
as you see,
exec
has the whole selected text, whereas
plan
contains a QuestDB execution plan only of the first query. The remainder after
;
was discarded. Perhaps this could be considered a bug of web console. After all, the selected query and execution differ. However, web console is displaying exactly what it sends to QuestDB and truncating that might be undesirable or even misleading in some cases. For these reasons i'd argue that current web console behaviour is correct. I'm totally open for UI improvement suggestions, if you'd have any! On a side note, i noticed you use QuestDB v6.5.3. Just recently a new v6.5.4 version was released, you might want to upgrade. It includes some goodies for web console, one of which will reduce the amount of manual query selecting with your mouse. You can try it out on our live demo: https://demo.questdb.io/
s

Sam Shiles

10/24/2022, 4:27 PM
Hi @Arijus Šukys many thanks for your response. Makes sense. I was trying to execute multiple COPY statement to import and I got around it by writing a quick script using the pg client, so I'm all good for now. I downloaded the latest docker hub image first thing this morning and it looks as though 6.5.4 was only pushed to docker hub about 4 hours ago, I'll give it a go. On another note, I've now got some "big" data loaded. I have a table with 411m records. I'm so far finding that some simple queries I'm running are much slower than they would be on mysql, I'm wondering if it's a schema issue or perhaps a server config issue. What's the best forum for getting some guidance on this?
Arijus Šukys

Arijus Šukys

10/24/2022, 4:29 PM
Yes, v6.5.4 is very fresh from the oven, just from few hours ago!
Pei

Pei

10/24/2022, 4:30 PM
On another note, I’ve now got some “big” data loaded. I have a table with 411m records. I’m so far finding that some simple queries I’m running are much slower than they would be on mysql, I’m wondering if it’s a schema issue or perhaps a server config issue. What’s the best forum for getting some guidance on this?
Hi Sam, could you maybe share your table schema and perhaps some query examples that you found out that are slower? (You could right click on the table and copy the schema).