My personal and professional life
2020-07-20
2020-05-23
Happy 25th Birthday MySQL!
- First and foremost, MySQL is the relational (and also non-relational) database of choice for both my personal and professional projects. For me it's easier to think new database schemes in the terms of MySQL and architect new systems on top of MySQL as a database system;
- MySQL is getting better and better with the years, which keeps me interested. I still remember the arrival of:
- 4.0 (with support for unions, etc.),
- then 4.1 (sub-queries and prepared statements, etc.),
- then 5.0 (stored routines, triggers and views, distributed transactions, etc.),
- then 5.1 (table partitioning, XML and event scheduler, etc.),
- then 5.5 (SIGNAL and RESIGNAL, PERFORMANCE_SCHEMA),
- then 5.6 (Full-text for InnoDB, etc.),
- then 5.7 (JSON, named triggers, generated columns, optimizer hints, etc.),
- and more recently 8.0 (CTEs, window functions, regular expressions improvements, GROUPING function, document store, CHECK constraints, LATERAL, functional key parts and defaults and many, many more);
- I'm building MySQL server (and other products) for Slackware Linux since 2005, because at first I needed newer versions than the ones provided by the official repository and then, because Slackware switched to MariaDB in 2013, but I choose to stick with MySQL. This doesn't mean I do not use MariaDB at all and in some aspects I believe it's ahead;
- I'm reporting bugs for MySQL and related products, so I could get problems resolved (see the story of some of my bug reports);
- I'm blogging about MySQL for the past 2 years since the release of MySQL 8.0, which helps me get familiar with the new features;
- I'm also presenting about MySQL from time to time, which helps me engage with the community, learn from and exchange ideas with the more experienced then me;
- Last, but definitely not least, there is a great and very strong community around MySQL, with which I got the chance to engage more in the past 3 years. This is what makes a project like MySQL strong over so many years.
Публикувано от
Georgi D. Sotirov
в
00:01
0
коментара
Етикети: MySQL, Slackware, SQL, Technology
2020-05-03
MySQL 8.0.20 released
- New index-level optimizer hints for existing index hints (mind the difference!) that include the following.
- GROUP_INDEX/NO_GROUP_INDEX as equivalent to FORCE INDEX FOR GROUP BY/IGNORE INDEX FOR GROUP BY index hints;
- INDEX/NO_INDEX as equivalent to FORCE INDEX/IGNORE INDEX index hints;
- JOIN_INDEX/NO_JOIN_INDEX as equivalent to FORCE INDEX FOR JOIN/IGNORE INDEX FOR JOIN index hints;
- ORDER_INDEX/NO_ORDER_INDEX as equivalent to FORCE INDEX FOR ORDER BY/IGNORE INDEX FOR ORDER BY index hints;
- Hash join optimizations now supports also outer, anti and semi join types, which means that for the hash join to work it is no longer necessary to have at least one equi-join condition.
- There are several improvements to EXPLAIN statement:
- with FORMAT=TREE includes new inversion information for windowing functions. Unfortunately, I found no further information on this;
- with FORMAT=TREE provides more information about evaluated window functions matching that supplied for regular aggregates. You should now see lines like "Window aggregate with buffering";
- for ANALYZE there is now the possibility to stop the execution with KILL QUERY or CTRL+C key combination on the command line;
- ANALYZE should now support the FORMAT option with the only possible value of TREE as reflected in the release notes and the manual, but for me it results in error.
mysql> EXPLAIN ANALYZE FORMAT=TREE SELECT 1+1;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FORMAT=TREE SELECT 1+1' at line 1
Anyway, I hope this is the first step in implementing support for this command in Workbench in future (see bug 97282).
- Some improvements and deprecations to the SQL syntax related to INTO and UNION clauses (see SQL Syntax Notes from the release notes);
- VALUES function for INSERT … ON DUPLICATE KEY UPDATE statement is now deprecated as I guessed in my post for MySQL 8.0.19 release;
- ON ERROR before ON EMPTY clauses for column definitions in JSON_TABLE function;
- The mentioned above index hints.
Публикувано от
Georgi D. Sotirov
в
20:15
0
коментара
Етикети: MySQL
2020-02-29
Migrations to Git and GitHub continue
- tags or branches with similar names (e.g. TEST-123 and TEST_123). Those are easy to correct - I just delete the wrong tag/branch;
- misplaced tags or branches. Since in CVS I was tagging and branching as necessary some tags and branches were put on different files at different time, which in Git history resulted in commits with the message "This commit was manufactured by cvs2git to create tag 'TEST-123'" or "This commit was manufactured by cvs2git to create branch 'TEST-123'" with files being added, deleted or modified to adjust history for the tag or branch respectively. I'm fixing such problems by reordering the problematic commits, which is easy by just changing the time in the revision control file in the repository, but requires time to review and understand the reason;
- unused files not deleted in version history. This also produced the commits with messages mentioned in the previous bullet point. I'm fixing these by deleting the unused files with past date, so such files are not considered by consecutive commits;
- files belonging to a branch, but committed to main trunk instead. It's similar to the above. In some cases, there are files that should exist only on some branch (e.g. like patches to fix issues with specific software versions), but were committed to main trunk. As in CVS there is no big difference between tags and branches it was enough just to tag the changes for checking out properly. I'm moving these from main trunk into a branch, which means deleting revisions from main trunk and moving them on the branch;
- spelling errors. Since I mostly committed to CVS on the command line and I did not use spell checker there were many commit messages with spelling errors that irritate my eyes. I'm correcting them after initial migration to Git, so I could check all messages at once.
Anyway, this post is to note that my migrations to Git continue. I've made great progress last year by migrating 28 repositories. And this year by now I migrated 114 more. So hopefully by the end of the year I'll be free from using CVS (or at least only by exception). Initially I planned migrating everything, but now I consider skipping some low value projects or examples, which if necessary, I could migrate later.
Публикувано от
Georgi D. Sotirov
в
22:30
0
коментара
Етикети: Development, Git
2020-01-17
MySQL 8.0.19 suite released
SQL syntax
Datatype changes
TINYINT(1) and ZEROFILL attribute.Other changes in server
FAILED_LOGIN_ATTEMPTS login attempts for PASSWORD_LOCK_TIME days (see Failed-Login Tracking and Temporary Account Locking), compression in X protocol (see Connection Compression with X Plugin) and many more as you could find from the release notes.Bugs fixed in server
Workbench
Публикувано от
Georgi D. Sotirov
в
22:31
0
коментара
Етикети: MySQL
2020-01-09
Using xrdp on various Linuxes and a problem on Fedora
- Install necessary packages: dnf install xrdp xorgxrdp
- Edit /etc/xrdp/xrdp.ini and enable Xorg sessions;
- Enable access by anybody or just specific users, e.g. echo "allowed_users = anybody" >> /etc/X11/Xwrapper.config (see also bug 1450720);
- Enable port 3389 on the firewall, e.g. firewall-cmd --zone=dmz --add-port=3389/tcp
- Point your RDP client to the Linux machine and have fun.
[20200109-10:12:53] [CORE ] waiting for window manager (pid 4902) to exit
[20200109-10:12:57] [CORE ] window manager (pid 4902) did exit, cleaning up session
[20200109-10:12:57] [INFO ] calling auth_stop_session and auth_end from pid 4877
Investigating the reason, I noticed the following in the journal (e.g. with journalctl -r):
Jan 09 10:12:55 fedora systemd[4881]: gnome-shell-x11.service: Failed with result 'protocol'.
Jan 09 10:12:55 fedora gnome-shell[5157]: Current serial number in output stream: 359
Jan 09 10:12:55 fedora gnome-shell[5157]: Serial number of failed request: 358
Jan 09 10:12:55 fedora gnome-shell[5157]: Minor opcode of failed request: 7 (RRSetScreenSize)
Jan 09 10:12:55 fedora gnome-shell[5157]: Major opcode of failed request: 139 (RANDR)
Jan 09 10:12:55 fedora gnome-shell[5157]: X Error of failed request: BadMatch (invalid parameter attributes)
Jan 09 10:12:55 fedora xrdp-sesman[4870]: rdpRRScreenSetSize: not allowing resize
Jan 09 10:12:55 fedora xrdp-sesman[4870]: rdpRRScreenSetSize: width 1688 height 932 mmWidth 447 mmHeight 247
Jan 09 10:12:55 fedora gnome-shell[5157]: Xlib: extension "DPMS" missing on display ":10.0".
Jan 09 10:12:55 fedora xrdp-sesman[4870]: rdpRRGetInfo:
So, gnome-shell was failing actually. Initially, I found bug 1575792, which seemed similar, but it wasn't resolved. Finally, the problem turned out to be the latest version of xorgxrdp 0.2.12 (see issue #156). I had to simply downgrade to xorgxrdp 0.2.11, by forcefully installing the RHEL 8's xorgxrdp package like this:
And things are again back to normal.
Update 2020-01-14: Of course it's good to eclude package xorgxrdp from upgrades (see Excluding Packages From Transactions) or simply echo "excludepkgs=xorgxrdp" >> /etc/dnf/dnf.conf as one line command.
Happy using your favorite Linux distro!
Публикувано от
Georgi D. Sotirov
в
19:30
2
коментара
Етикети: Fedora, Linux, Virtualization
2019-12-25
Bugzilla in Bulgarian on GitHub
Публикувано от
Georgi D. Sotirov
в
16:19
0
коментара
Етикети: Bugzilla BG, Translations
2019-12-05
Picture-in-picture mode for videos in Firefox 71
Публикувано от
Georgi D. Sotirov
в
18:11
0
коментара
2019-10-18
New features in MySQL 8.0.18
Hash join optimization
- Nested-Loop Join - it's the simplest where each row from the outer loop is passed to the inner loop for processing. The obvious drawback of this one is that the inner table needs to be read many times.
- Block Nested Loop (BNL) - uses buffering of rows from the outer table to reduce the number of times the inner table is read. In this case instead of passing just one row to the inner loop multiple rows from the buffer could be passed at once. This greatly reduces the number of time the inner table needs to be read. Of course, this requires more memory (see join_buffer_size). This algorithm is used for range, index and ALL join types.
SELECT E.ename, E.sal, JS.sal_min, JS.sal_max
FROM emp E,
job_sal JS
WHERE E.job = JS.job
AND E.sal NOT BETWEEN JS.sal_min AND JS.sal_max;
+----------------------------------------------------------------------------------------+
| EXPLAIN |
+----------------------------------------------------------------------------------------+
| -> Filter: (E.sal not between JS.sal_min and JS.sal_max) (cost=499211.71 rows=442901)
-> Inner hash join (E.job = JS.job) (cost=499211.71 rows=442901)
-> Table scan on E (cost=1962.39 rows=996514)
-> Hash
-> Table scan on JS (cost=0.75 rows=5)
|
+----------------------------------------------------------------------------------------+
1 row in set (0.0023 sec)
EXPLAIN ANALYZE
- the time for returning the first row (in ms);
- the time for returning all rows (in ms);
- the number of rows read;
- the number of loops.
+-------------------------------------------------------------------------------------------------------+
| EXPLAIN |
+-------------------------------------------------------------------------------------------------------+
| -> Filter: (E.sal not between JS.sal_min and JS.sal_max)
(cost=502072.82 rows=442901) (actual time=0.372..747.742 rows=915768 loops=1)
-> Inner hash join (E.job = JS.job)
(cost=502072.82 rows=442901) (actual time=0.355..575.011 rows=1000014 loops=1)
-> Table scan on E (cost=2534.62 rows=996514) (actual time=0.185..353.877 rows=1000014 loops=1)
-> Hash
-> Table scan on JS (cost=0.75 rows=5) (actual time=0.133..0.144 rows=5 loops=1)
|
+-------------------------------------------------------------------------------------------------------+
1 row in set (0.7754 sec)
MySQL is OpenSSL only
With this version the support for YaSSL and WolfSSL libraries are removed, so MySQL could be compiled only with OpenSSL. I have personally always built MySQL with OpenSSL (i.e. using option -DWITH_SSL=system), because this is what comes with Slackware, but of course the more important is that "the MySQL/OpenSSL combination is very well tested and production proven" as Georgi Kodinov explained in his post MySQL is OpenSSL-only now !.Spatial
Point and Point, or Point and MultiPoint as before.Update 2019-11-09: That timings are in milliseconds wasn't specified in the manual, so I filed bug 97492 as I also think that it would be good to print the unit next to timings.
Публикувано от
Georgi D. Sotirov
в
12:55
0
коментара
Етикети: MySQL
2019-09-29
New usages of TREE explain plan in MySQL
- HASH joins would be visible only in TREE format. I find this rather strange, because you would expect to see this operation no matter the format of the plan, so I hope it's extended in future.
- EXPLAIN ANALYZE would actually run the query and provide timing information about it's execution. I would also include additional iterator-based information about how the optimizer estimations compares to the actual execution.
Публикувано от
Georgi D. Sotirov
в
16:59
0
коментара
Етикети: MySQL

