Problem
<p dir="auto">Sometimes you want to get info about performance and execution time of your SQL queries but if you use <a href="https://sql.steemhelpers.com" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">SteemSQL Wrapper API then you need to calculate the time of each request yourself. It is very simple to do but you need to calculate it for each request and each project which you have.
<h4><a href="https://sql.steemhelpers.com" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Solution
<p dir="auto"><img src="https://images.hive.blog/768x0/https://res.cloudinary.com/hpiynhbhq/image/upload/v1515955122/vgw0nws9m872fhbphb5p.png" alt="image.png" srcset="https://images.hive.blog/768x0/https://res.cloudinary.com/hpiynhbhq/image/upload/v1515955122/vgw0nws9m872fhbphb5p.png 1x, https://images.hive.blog/1536x0/https://res.cloudinary.com/hpiynhbhq/image/upload/v1515955122/vgw0nws9m872fhbphb5p.png 2x" />
<p dir="auto">So I updated SteemSQL Wrapper API and now each response returns also the <code>execution_time field which has the execution time of your SQL in seconds.
<p dir="auto"><strong>cURL Example:
<pre><code>curl \
-d '{"query": "SELECT COUNT(*) as accounts FROM TxAccountCreates"}' \
https://sql.steemhelpers.com/api
<p dir="auto"><strong>Response:
<pre><code>{
"headers": ["accounts"],
"rows": [{"accounts": 591622}],
"error": null,
"execution_time": 0
}
<p dir="auto">In the most of simple queries, you will get <code>execution_time: 0 and in fact if you are developing some app using SteemSQL Wrapper API (actually this point is related to any external resources which you use to get Steemit data in your project) then you need to aim to exactly this result.
<p dir="auto">However, for example, the next query sometimes can return <code>execution_time: 5
<pre><code>SELECT TOP 30 author, category, net_votes, title, url
FROM Comments
WHERE depth=0 AND created >= '2017/12/20' AND created < '2018/01/15'
ORDER BY net_votes DESC
<h4>Frontend
<p dir="auto">But it is only a part of the update. Information about execution time of your SQL queries is also useful if you do not use API and use only the web interface. In fact, in the web interface it is even more useful than in API, especially if you only learn SQL and do not know enough about optimizations. So now after each request you will see the <code>Execution time card.
<p dir="auto"><img src="https://images.hive.blog/768x0/https://res.cloudinary.com/hpiynhbhq/image/upload/v1516130238/le9ikpo4zwg6aypfrinr.png" alt="image.png" srcset="https://images.hive.blog/768x0/https://res.cloudinary.com/hpiynhbhq/image/upload/v1516130238/le9ikpo4zwg6aypfrinr.png 1x, https://images.hive.blog/1536x0/https://res.cloudinary.com/hpiynhbhq/image/upload/v1516130238/le9ikpo4zwg6aypfrinr.png 2x" />
<h4>SteemSQL Wrapper
<p dir="auto">SteemSQL Wrapper allows use SteemSQL right in your browser without any dependencies. It even allows using the several most popular queries with one click. It means that non-tech users no longer need to install any drivers/Excel and learn programming languages. They can just go to SteemSQL Wrapper and write any SQL queries to get results right in their browser. Moreover, the project displays the database structure and users can know exactly what tables and columns they need and how to create analyses which they want.
<p dir="auto"><a href="https://github.com/sihaelov/steemsql-wrapper/commit/1c05727428bc5706e02c379c301d66f33f14129f" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Commit<br />
<a href="https://github.com/sihaelov/steemsql-wrapper/commit/ea143c9607089c1bcf61eb342353667270bb436d" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Commit #2
<p dir="auto"><br /><hr /><em>Posted on <a href="https://utopian.io/utopian-io/@emptyname/steemsql-wrapper-added-execution-time-of-sql-queries-to-api" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Utopian.io - Rewarding Open Source Contributors<hr /><p>
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Thank you :)
Hey @vladimir-simovic, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Your contribution cannot be approved yet because it does not have proof of work. See the Utopian Rules. Please edit your contribution and add proof (links, screenshots, commits, etc) of your work, to reapply for approval.
We have new Rules:
You may edit your post here, as shown below:
You can contact us on Discord.
[utopian-moderator]
I know about changing of the rules but in fact, my publication fully complies with the new rules — my github profile has proof of work. Were you checking it?
Sorry but I had to overrule the moderators decision. Your commit shows 5 simple lines, that were added. This might be an important/useful change but considering the high reward for development contributions, I don't think this should be rewarded with hundreds of dollars.
Please try to group more changes/additions into one contribution so that the reward becomes more reasonable.
You can contact us on Discord.
[utopian-moderator]
What if I will add displaying of execution time to the frontend, so also users who use the web interface will get a possibility to view execution time of their SQL queries? Will it enough?
cool tool, I just start playing with it to check my SQL
A real helper for SQL newbies or for people like me who did the last SQL programming 20 years ago....
I need to work my into the tables a bit more to get good results
Ah, thanks!
Hey @emptyname I am @utopian-io. I have just upvoted you!
Achievements
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x