r/mysql

▲ 6 r/mysql+1 crossposts

MySQL query becomes extremely slow when adding a JOIN and ORDER BY — how would you debug this?

I'm dealing with a performance issue in MySQL where a query runs relatively fast when executed against a single table, but becomes significantly slower after adding a JOIN and an ORDER BY clause.

The tables have millions of rows, and there are indexes on the columns used in the JOIN and WHERE conditions. However, the query optimizer still seems to choose a suboptimal execution plan.

I'm wondering what the best approach would be to troubleshoot this kind of issue.

Would you start by analyzing EXPLAIN ANALYZE, checking index cardinality, investigating temporary tables and filesorts, or looking at something else?

Also, under what circumstances would MySQL choose not to use an existing index even when it seems beneficial?

I'd appreciate any insights into how experienced MySQL developers approach this problem.

reddit.com
u/Competitive-Talk1321 — 5 days ago
▲ 8 r/mysql

How do MariaDB users securely and efficiently encrypt mariadb-backup archives?

Hello everyone!
I’m looking for practical recommendations from people running MariaDB in production.

My backup process will use mariadb-backup with zstd compression, and I want to encrypt the resulting backup securely without adding (too much) excessive CPU, memory, or operational overhead.

I’ve considered GPG/PGP, but I’m concerned about its performance and complexity. I’ve also seen age recommended, although I’m unsure whether it provides an appropriate security level for long-term MariaDB backups.

What encryption method or workflow do you use for MariaDB backups?

In particular, I’d appreciate feedback on:

  • Encryption tools and algorithms you use.
  • Whether encryption happens before or after compression.
  • CPU and performance impact on large backups.
  • Key management, rotation, and recovery procedures.
  • Whether you encrypt locally, stream directly to object storage, or use storage-side encryption (which unfortunately is not available to my usecase).
  • Any practical issues with restoring backups during an outage.

I’m mainly interested in real-world experience rather than theoretical recommendations.

reddit.com
u/eachDayIWakeUp — 10 days ago
▲ 60 r/mysql+5 crossposts

Are you running Wordpress on MariaDB or something else? Survey on database usage open

Hey, Robert from the MariaDB Foundation here. We got a lot of WordPress responses when I shared our survey here last year, so I thought I'd share that this year's edition is open:

https://mariadb.typeform.com/to/tS69UzVo?utm_source=reddit_wordpress

We revamped the questions for broader insights: MariaDB, MySQL, PostgreSQL or other database users are welcome. We also split questions by role (developer, dba, provider, etc), so just answer the ones that fit you.

We read every answer, and the anonymous results including free-text answers will again be public on mariadb.org/survey . You'll be done in under 10 minutes :) Thanks for taking the time!

A lot of WordPress runs on MariaDB, so your voice really counts here.
Robert, MariaDB Foundation

u/robertsilen — 13 days ago