[SteemSQL Wrapper] Added execution time of SQL queries

in #utopian-io7 years ago (edited)

Problem

Sometimes you want to get info about performance and execution time of your SQL queries but if you use 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.

Solution

image.png

So I updated SteemSQL Wrapper API and now each response returns also the execution_time field which has the execution time of your SQL in seconds.

cURL Example:

curl \
-d '{"query": "SELECT COUNT(*) as accounts FROM TxAccountCreates"}' \
https://sql.steemhelpers.com/api

Response:

{
    "headers": ["accounts"],
    "rows": [{"accounts": 591622}],
    "error": null,
    "execution_time": 0
}

In the most of simple queries, you will get 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.

However, for example, the next query sometimes can return execution_time: 5

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

Frontend

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 Execution time card.

image.png

SteemSQL Wrapper

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.

Commit
Commit #2



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

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:

  • If your username on Github does not correspond to the Utopian username you must use the "Name" field in the Github settings and enter there your Utopian/Steem username to verify you are the author.

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?

image

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

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

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

Coin Marketplace

STEEM 0.21
TRX 0.20
JST 0.034
BTC 91782.03
ETH 3133.14
USDT 1.00
SBD 3.00