Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand the short SQL in Oracle and MySQL

2025-02-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how to understand the short SQL in Oracle and MySQL. The content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.

If you were asked to write a simple and awesome SQL, regardless of the database type, what kind of SQL statement would you write?

Oracle

If it's Oracle, I'll write a drop table dual.

This SQL looks very simple, contains a large amount of information, first of all, you have to have some understanding and understanding of the dual table, and this view is different from the general data dictionary, if deleted, it will directly lead to the database unavailable. Recovery requires an implicit parameter to adjust.

Of course, if you want to write some SQL with philosophy of life from a different point of view, it will take a lot of work.

I thought of one, such as Flashback database to sysdate-1/24/60.

What I'm trying to say is that the database can flash back to a minute ago, and our lives won't, none of them.

MySQL

I really thought a lot about writing a few SQL in this respect from the perspective of MySQL, but I didn't feel very satisfied until I saw a MySQL performance test statement provided by jeremycole, which was simple but powerful.

Https://github.com/jeremycole/yesmark can be seen on github

Statement on one line:

Yes "DO 0;" | mysql > / dev/null &

If you want to open a parallel, that's not a problem, such as 16 concurrency.

For i in {1... 16}; do yes "DO 0;" | mysql > / dev/null & done

Such sentences are really short and concise.

On how to understand Oracle and MySQL in the short SQL to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report