![blind write in dbms blind write in dbms](https://media.springernature.com/original/springer-static/image/chp:10.1007%2F978-3-319-76348-4_83/MediaObjects/462455_1_En_83_Fig3_HTML.gif)
SELECT MAX(agg_col), gb_col FROM t GROUP BY gb_colīut it isn't easy when you want other columns - columns that are not used for group by or aggregation. The answer is easy if you only want the aggregated and group by columns: I updated the output for the queries with SHOW STATUS printed after each query. Reproduction SQL is here and here and output from MySQL 8.0.22 is here and here.
BLIND WRITE IN DBMS SERIES
My motivation for writing this was a slow query plan for MySQL 8.0.22 while implementing the Time Series Benchmark Suite (TSBS) for MySQL. I am writing about SQL rather than SQL engines and I am not an expert on writing SQL queries, but that might be appropriate given that I am writing about something that confuses users and could be easier. By sad answers only I mean there is a lot of confusion about this, StackOverflow has over 3000 posts, and the query is harder to write than it needs to be. By max row I mean the aggregated columns, group by columns and other columns for the row that has the max or min value in a group. The tag greatest-n-per-group is for answers to questions about writing SQL to find the max row per group. Today I learned that frequently asked questions on StackOverflow get their own tag. The rest of this post assumes a SQL DBMS and a simple schema. When a DBMS has the row then it has the required information, but a read must be done to get the row and we are discussing ways to avoid that read. To perform these steps both the index column values and row pointer must be known.
![blind write in dbms blind write in dbms](https://image.slidesharecdn.com/1505-unit-3serializability-171122045518/95/serializability-in-dbms-6-638.jpg)
![blind write in dbms blind write in dbms](https://i.ytimg.com/vi/VO_MI6FSKcM/maxresdefault.jpg)
The typical index maintenance after a write consists of some of remove old index entry, insert new index entry. The row pointer is usually a row ID or the value of the row's primary key columns.