heavyai / heavydb

HeavyDB (formerly OmniSciDB)
https://heavy.ai
Apache License 2.0
2.93k stars 445 forks source link

Execute query without printing results to console #741

Closed jiashenC closed 2 years ago

jiashenC commented 2 years ago

I am trying to do some performance study for HeavyDB. I wonder is there a way to disable results printing to console?

In my case, the number of projected rows is high, so it can affect the runtime of the query.

cdessanti commented 2 years ago

Hi, We haven't such functionality in the heavysql tool so you can mimic it by embedding the query into a select * from (your query) limit 0.

This would run every step into the inner query without returning the result set. I'm almost sure the optimizer isn't pushing anything into the inner query.

andrewseidl commented 2 years ago

You could try either \timing inside a session or heavysql --timing ... to enable reporting of some basic timings from the server.

$ build/bin/heavysql --timing
User admin connected to database heavyai
heavysql> select count(*) from wi_parcels2;
EXPR$0
3520942
1 rows returned.
Execution time: 14 ms, Total time: 14 ms

Execution time is the amount spent doing actual calculations, Total time includes everything such as loading data from disk (if not already in memory), execution, preparing results, etc. These times are coming directly from the server, so you don't have to worry about network traffic, slow consoles printing results, etc.

I believe those timings are also exposed from our Python, Java, and Javascript connectors, though they might be a little hidden.

jiashenC commented 2 years ago

Close this issue for now.

I will go with limit 0 for now as I try to automate different queries profiling.

cdessanti commented 2 years ago

MI think we will have something soon in the information schema, but in the meantime you can get some insights about the running time in the queries checking this post in the community's forum.

https://community.heavy.ai/t/tpc-h-data-loading/2547/6?u=candido.dessanti


From: Jiashen Cao @.> Sent: Wednesday, June 8, 2022 10:20:03 PM To: heavyai/heavydb @.> Cc: Candido Dessanti @.>; Comment @.> Subject: Re: [heavyai/heavydb] Execute query without printing results to console (Issue #741)

Close this issue for now.

I will go with limit 0 for now as I try to automate different queries profiling.

— Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fheavyai%2Fheavydb%2Fissues%2F741%23issuecomment-1150367901&data=05%7C01%7C%7C7f52e08bc10a4da41de508da498c45b5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637903164054405376%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3Yv1poT%2FuiZnYW2t9Kn5babwZeMqhjlGGa%2BnHSDk404%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAHLFBF6DWJBDJWY26XWPWJTVOD57HANCNFSM5YGZ3UIQ&data=05%7C01%7C%7C7f52e08bc10a4da41de508da498c45b5%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637903164054405376%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=X9Q6BzeXOY2meiPdLkHe3jG16KjhjuVajzUwedXtoAA%3D&reserved=0. You are receiving this because you commented.Message ID: @.***>