-
MySQL on the Road in 2026
Conference highlights and where to meet us next This year, MySQL conversations took us from Brussels to São Paulo, from developer conferences to open source gatherings across Asia. Thank you to everyone who stopped by our tables and booths, joined a session, asked a question, or shared how you use MySQL. For this Advent Calendar […]
-
Jev-Style Decision Models in MySQL with vsql-ai
Decision models such as TypeSafe's Jev, Google's Gemini Decision 1, and OpenAI's Decisions API answer a question about an input with a probability, which makes them useful for classifying rows in a database. Getting a probability score from these models takes one API call per input. The harder part is choosing the cutoff that counts as yes, and knowing that it's right for your data.OpenAI's guide on this topic gives an answer: "Use labeled examples from your application to set thresholds for routing, filtering, or review." That means that to derive a threshold, you need some rows where you already know the right answer. Your application may already store these answers. For example, a support application may record which team resolved each ticket. Before you use a stored answer as a label, check two things: that it answers the same question that you ask the model, and that it is correct.If you don't have such a column, you can label a sample of rows by hand and store each label in a column next to the input. Label at least 100 to 150 rows of each answer (more when an answer is rare). Either way, the labels should be in the same table as the data. The vsql-ai extension can then write a decision model's probabilities there too, so checking a threshold becomes a query.vsql-ai is an extension that runs on VillageSQL, a drop-in replacement for MySQL that adds PostgreSQL-style extensions to MySQL. Its ai_decision() function lets a database call decision APIs directly from SQL. The rest of this post walks through an example of using this function.Asking a decision model from SQLThe example in this post is a support team that wants to send billing tickets to a billing queue and other tickets to a general queue. We wrote 20 short support tickets for it and labeled each one by hand, 10 as billing and 10 as other. That is enough to show the method, but too few to choose a real threshold. The tickets are in a tickets table, with the ticket text in a body column, our label in an is_billing column, and an empty JSON column, answers, for the model's response.Setup takes two statements. First, you store the API key in the MySQL keyring, where vsql-ai 0.0.9 reads it. After that, everything refers to the key by name, so a query does not carry the key itself:SELECT keyring_key_store('gemini_key', 'SECRET', '<your API key>');
Then, you register the model under a model ID, with the provider, the model name, the key's name, and the account that stored the key:SET GLOBAL vsql_ai.models = '{
"decide": {"provider": "google", "model": "gemini-decision-1",
"key_id": "gemini_key", "key_owner": "root@localhost"}
}';
ai_decision(model_id, input, questions) then takes that model ID, the text to judge, and a JSON object of named questions. This post asks one yes/no question, which vsql-ai calls a noul. You can have more than one question in the JSON, though. The model doesn't know anything about your business. It judges each ticket against the instructions and criteria that you write, so their wording shapes every probability:SET @questions = '{
"is_billing": {"type": "noul", "instructions": "Is this message about billing?",
"criteria": {"true": "About charges, invoices, payments or refunds",
"false": "About anything else"}}
}';
This UPDATE asks the model about every ticket and stores each answer in the answers column:UPDATE tickets SET answers = ai_decision('decide', body, @questions);
Each answer is JSON, keyed by question name. For ticket 3 ("Your app logged me out and now my card on file shows an error when I try to upgrade."), Gemini Decision 1 returned this:{"is_billing": {"noul": 0.8528589448473877, "type": "noul", "confidence": 0.8528589448473877}}
The noul value is the probability that the answer is yes.Choosing a threshold from labeled rowsWith the answers stored, one query puts each ticket's text, our label, and Gemini Decision 1's probability side by side:SELECT id, body, is_billing,
ROUND(JSON_VALUE(answers, '$.is_billing.noul' RETURNING DOUBLE), 3) AS p_billing
FROM tickets ORDER BY id;
id
Ticket
is_billing
p_billing
1
I was charged twice for my November invoice. Please refund the duplicate charge today.
1
0.974
2
How do I export my data to CSV?
0
0.01
3
Your app logged me out and now my card on file shows an error when I try to upgrade.
1
0.853
4
Love the new dashboard, great work!
0
0.024
5
Can I get a receipt with our VAT number on it? Not urgent.
1
0.97
6
Production is down since the 2am deploy and every request returns 500.
0
0.012
7
Why did my bill go up this month? Nothing changed on our side.
1
0.978
8
The search box ignores accented characters.
0
0.03
9
Please cancel our subscription at the end of the term.
1
0.771
10
Can you add SSO with Okta?
0
0.026
11
We hit the plan limit on seats. What happens to the extra users?
1
0.415
12
The invoice PDF link in the email returns a 404.
1
0.925
13
How much does the enterprise tier cost compared to what we pay now?
1
0.923
14
Our trial ended and the account is locked. We want to keep testing for a week.
0
0.177
15
Password reset email never arrives.
0
0.025
16
Is there a discount for nonprofits?
1
0.918
17
The mobile app crashes when I open settings.
0
0.031
18
Who do I talk to about moving our account to a different company entity?
0
0.28
19
Our finance team needs last year's statements for the audit.
1
0.406
20
Dark mode makes the charts unreadable.
0
0.026
Most tickets were clear. The middle of the range held the judgment calls. We labeled tickets 11 and 19 as billing, and the model gave them 0.415 and 0.406. We labeled tickets 18 and 14 as other, and the model gave them 0.28 and 0.177.The following query compares several thresholds against the labels:SELECT t.threshold,
SUM(p >= t.threshold AND is_billing) AS true_pos,
SUM(p >= t.threshold AND NOT is_billing) AS false_pos,
SUM(p < t.threshold AND is_billing) AS missed,
ROUND(SUM(p >= t.threshold AND is_billing)
/ NULLIF(SUM(p >= t.threshold), 0), 2) AS prec,
ROUND(SUM(p >= t.threshold AND is_billing) / SUM(is_billing), 2) AS recall
FROM (SELECT is_billing,
JSON_VALUE(answers, '$.is_billing.noul' RETURNING DOUBLE) AS p
FROM tickets) s
CROSS JOIN (SELECT 0.1 AS threshold UNION ALL SELECT 0.3 UNION ALL SELECT 0.5
UNION ALL SELECT 0.7 UNION ALL SELECT 0.9) t
GROUP BY t.threshold ORDER BY t.threshold;
With the result of:threshold true_pos false_pos missed prec recall
0.1 10 2 0 0.83 1.00
0.3 10 0 0 1.00 1.00
0.5 8 0 2 1.00 0.80
0.7 8 0 2 1.00 0.80
0.9 6 0 4 1.00 0.60
prec is precision, the share of tickets at or above the threshold that really are billing, and recall is the share of billing tickets that the threshold catches. The obvious default, 0.5, misses two of the 10 billing tickets. On these rows, 0.3 catches all of them and does not flag any "other" ticket.Treat 0.3 as an example, not a magic number for your own data. We picked it and scored it on the exact same 20 rows. The labels are just our judgment calls, and the four tickets here are borderline enough that someone else might label them differently.The sample is also too small. At 0.3, recall is 10 out of 10, which sounds perfect, except a 10-for-10 result still leaves room for a true miss rate as high as 26% (at 95% confidence). Catching 140 out of 140 drops that bound to about 2%. Meanwhile, the gap between 0.3 and 0.5 is just two tickets, which is well within random noise. With real traffic, split your labeled rows: pick the threshold on one part and check it on the rest. The query doesn't change at any size, so rerun it whenever you label more rows or reword a question.Rows without a probability can also skew the table. A failed call returns NULL with a warning, and an OpenAI refusal doesn't carry a probability. Such a billing row counts as neither caught nor missed, but it still counts in the recall total, so recall reads lower and missed doesn't show why. Find those rows before you run the threshold query, and call the model again for them:SELECT id FROM tickets
WHERE JSON_VALUE(answers, '$.is_billing.noul' RETURNING DOUBLE) IS NULL;
Comparing two models on the same rowsA threshold is linked to the model that produced its probabilities. vsql-ai works with Google's gemini-decision-1, TypeSafe's jev-latest (or a versioned ID such as jev-1.13.0), and OpenAI's gpt-6-luna, and it returns the same JSON from all three, so trying another model is a one-line change to the registry. We ran the same 20 tickets through gpt-6-luna, changing only that line. Its yes/no probabilities were much less spread out: 13 of the 20 answers came back as 0 or 1 (when rounded to three decimal places), so the model was sure, or very nearly sure, about most tickets. It also ranked the borderline tickets differently. It scored ticket 14 (the trial lockout) at 0.81 and ticket 19 (the audit statements) at 0.02, where Gemini Decision 1 gave 0.177 and 0.406.The same threshold query gives this result:threshold true_pos false_pos missed prec recall
0.1 9 1 1 0.90 0.90
0.3 9 1 1 0.90 0.90
0.5 9 1 1 0.90 0.90
0.7 9 1 1 0.90 0.90
0.9 6 0 4 1.00 0.60
The first four rows are the same because no ticket scored between 0.1 and 0.7. At each of those thresholds, gpt-6-luna flags ticket 14, which is not a billing ticket, and misses ticket 19, which is. Raising the threshold to 0.9 drops ticket 14, but it also misses three more billing tickets. A threshold can only trade one kind of mistake for the other within a model's ranking. Before you switch the model, run the same labeled rows through the new model and compare the two tables.Routing on a probabilityOnce you have a threshold, a CASE turns a probability into a routing decision. Instead of forcing a binary yes/no on every ticket—especially when 20 rows aren't enough to fully trust 0.3—you can use two cutoffs to separate clear cases from uncertain ones. Tickets at 0.9 or above go straight to the billing queue, anything between 0.3 and 0.9 goes to a person for review, and the rest go to the general queue:SELECT id, CASE
WHEN JSON_VALUE(answers, '$.is_billing.noul' RETURNING DOUBLE) >= 0.9 THEN 'billing queue'
WHEN JSON_VALUE(answers, '$.is_billing.noul' RETURNING DOUBLE) >= 0.3 THEN 'human review'
ELSE 'general queue'
END AS route
FROM tickets ORDER BY id;
On the 20 tickets, Gemini Decision 1's answers sent six to the billing queue, four (tickets 3, 9, 11, and 19) to human review, and 10 to the general queue.Trying it yourselfai_decision() is new in vsql-ai 0.0.9. vsql-ai uses VillageSQL preview capabilities, which are off by default, so turn them on before you install the extension:SET PERSIST vsql_allow_preview_extensions = ON;
INSTALL EXTENSION vsql_ai;
Each account that calls ai_decision() also needs the VSQL_AI_USER privilege. The README setup steps cover the keyring, the API key, and the model registry, and the Decisions section of the README has the full question and answer reference.
-
MySQL Community 2026: Growing Together
As the end of the year approaches, it is time for a familiar MySQL Community tradition: our Advent Calendar. From today through Dec 24, we will share a new post each day, bringing you practical learning, community stories, and a look back at what we have achieved together. We are opening this year’s calendar with […]
-
DBaaS Beyond the Hyperscalers, Part 1: MySQL Performance
DBaaS Beyond the Hyperscalers, Part 1: MySQL Performance
Research objective
In this series of posts we want to look at the non-hyperscaler cloud providers that offer MySQL and PostgreSQL DBaaS (DataBase as a Service) and answer two questions: which service delivers the most throughput out of the box, and which one gives the best cost efficiency per transaction.
The providers may sell the same shapes, but their performance can be very different. Also, the transaction cost is another factor apart from performance.
The current part covers MySQL performance. Part 2 covers PostgreSQL performance, and Part 3 covers cost efficiency for both. Details of the setup, workloads and metrics are in the Test Setup and Methodology reference.
What we tested
Each provider’s managed MySQL was tested at the same size, a typical startup-level general purpose tier: 4 shared vCPU, 16 GB RAM and 150 to 350 GB of SSD/NVMe storage. The services were benchmarked with Sysbench and HammerDB at three data set sizes (about 16, 32 and 64 GB), using the default configuration each provider applies.
Provider
Plan / Tier
MySQL Version
Scaleway
DB-PRO2-XS
8.0.21
UpCloud
Managed Database – Standard
8.4.11
Vultr
Startup General Purpose Optimised
8.4.11
OVHcloud
Discovery B3-16
8.4.11
Exoscale
Startup-16
8.4.11
Key findings
Exoscale was the fastest in every Sysbench scenario, with peak throughput almost 3.5 times that of the slowest provider (Scaleway).
Vultr, UpCloud and OVHcloud performed close to each other, between the two.
Scaleway was the slowest and had the highest latency. It is the only provider still on MySQL 8.0, which may explain part of the gap.
UpCloud did better in HammerDB than in Sysbench, but its service switched to read-only mode under heavy load, so not all runs completed.
Sysbench throughput
Exoscale leads, Scaleway trails, and the other three are close together.
Graph 1: Sysbench with 10M rows per table [ graph ] [ table ]
Exoscale is the clear leader in TPS. Vultr, UpCloud and OVHcloud are close to each other, and Scaleway showed the lowest performance. Since Scaleway is the only provider running MySQL 8.0 (the others use MySQL 8.4), the older server version may account for at least part of the difference.
The providers keep the same order with partially buffered data (20M rows per table) and in the more I/O-bound scenario (40M rows per table). See the interactive graphs for 20M rows and 40M rows.
Sysbench peak throughput
Exoscale’s peak is almost 3.5 times Scaleway’s.
Graph 2: Sysbench peak output with 10M rows per table [ graph ] [ table ]
P95 latency
Latency follows throughput: the fastest service responds quickest.
Graph 3: P95 latency [ graph ] [ table ]
Exoscale has the lowest latency and Scaleway the highest, with the other providers grouped in the middle. Latency for 20M rows and 40M rows per table shows the same pattern.
The higher latency for Scaleway is likely coming from the bandwidth limitation of 350 Mbps imposed on its compute instances used to run the benchmarks. While some providers put the transfer limit and charge extra cost for out of limit use, nobody else limited the network speed of the client to such a low number. Interesting that the database service had no speed limit, the weak link was the client connection. Even though it affected the throughput, running a client compute outside of the Scaleway network would cost even higher delays. Higher network speeds were available for disproportionally larger and expensive compute shapes compared to the database itself. In other words, the full potential of a startup Scaleway database service could not be fully realized using solutions for startup use alone.
HammerDB (TPC-C)
The ranking is similar to Sysbench, with UpCloud doing better.
Graph 4: HammerDB with 160 warehouses [ graph ] [ table ]
The performance distribution in HammerDB is similar to Sysbench, but UpCloud performs better here. Interactive graphs: 320 warehouses and 640 warehouses.
A note on reliability
All benchmarks ran three times to reduce noise from neighboring tenants on shared vCPUs. UpCloud’s managed MySQL did not always handle the elevated load: it kept switching the server into read-only mode, which disrupted testing, so not all of its runs produced results.
Next: PostgreSQL performance
Part 2 runs the managed PostgreSQL services of the same providers through HammerDB. Part 3 compares what each service costs per hour and how many transactions $1 buys on each one, for both databases.
The post DBaaS Beyond the Hyperscalers, Part 1: MySQL Performance appeared first on Percona.
-
DISA Releases Oracle MySQL 9.x STIG for MySQL Enterprise Edition 9.7 LTS
The Defense Information Systems Agency (DISA) has approved and released the Oracle MySQL 9.x Security Technical Implementation Guide (STIG), Version 1, Release 1, supporting MySQL Enterprise Edition 9.7 LTS. Published on November 30, 2026, the guide is available from the DoD Cyber Exchange and is effective immediately upon release. As an author of the MySQL […]
|