DEVHERO Write on WhatsApp
HelplineReal humans, not AI. Help within 24h
Human First
slow database queries

Slow database queries are holding the product back. We fix it within 24 hours.

Your app waits on the database.

  • CPU, I/O, or wait events on the database are high while the app looks idle
  • A report or an admin screen locks other users out
  • Pages that list or search are the slow ones

One free session per client: the first 4 hours with a specialist, plus unlimited AI as a tool.

A real senior specialist leads. Name on first reply. AI is a tool; a human checks the result.

01

The problem

What this problem looks like, how you can tell, and what is at stake if it stays.

What this problem looks like

What poor database performance looks like, why people fear migrations, and why we will not invent timings we have not measured.

The app is waiting on the database

CPU or I/O on the database is high. A report locks a table. An ORM issues N+1 queries. An index is missing, or the wrong one is used. Connection pools exhaust. A migration is mid-way. Users see spinners; jobs fall behind.

Everyone has a theory and nobody wants to touch the schema

The team is nervous about touching 'the data.' Everyone has a theory. You are one lock away from an incident.

Data that cannot be queried in time is data you do not really have

Data that cannot be queried in time is data you do not really have. A database is part of the product's promise, not a private cellar.

You want the slow queries found, indexed or rewritten, and the system stable — without a reckless migration at midnight.

Slow database queries make the whole product feel late: CPU or I/O is high, a report locks a table, an ORM issues N+1 queries, or a connection pool is exhausted. The team is nervous about touching the data.

A missing index, a bad plan, a lock, or a chatty ORM can dominate. Corruption is a different incident: we start with safety and backups, not with a casual rewrite. A major migration or a new store is a complex project.

Signs you have slow database queries or a database bottleneck

These clues point at the data layer, even if people first blame the web servers.

CPU, I/O, or wait events on the database are high while the app looks idle

Or connections sit at the pool limit.

A report or an admin screen locks other users out

A long transaction or a heavy read blocks writes, or the other way around.

Pages that list or search are the slow ones

The obvious table has grown, and the query has not.

An ORM log shows a query per row

N+1 is still a common, boring cause.

A migration is mid-way or keeps getting postponed

The fear is already part of the performance problem.

Jobs fall behind because they wait on the same database

The night batch and the website fight each other.

If the database stays slow, and if the hot path is improved

Before — if you leave it

If you leave it

A slow or locked database takes the application with it. Reports slip, checkouts hang, and a later incident is only a larger version of the same wait.

After — if we close it

If we close it

The worst queries are identified and improved, the risk of a bad rewrite is avoided, and you know what still needs a larger schema change.

Recognize your situation? Message us, we will sort it out.

02

Why it happens

Where this usually comes from, why it shows up in fast or AI-assisted work, and how to check it yourself.

Root causes of PostgreSQL, MySQL and similar slowness

Once you read the plan, the locks, and the volume, the cause is usually specific.

Missing or unused indexes

The planner scans too much, or an index exists and is the wrong one.

Queries that do too much work

SELECT *, unbounded lists, and reports written as if the table were still small.

Locks and long transactions

A session holds a lock while it talks to a user or a remote API.

Connection storms and pool mis-size

Too few connections and requests queue; too many and the database collapses.

Schema or data shape that no longer matches the access pattern

A design that was fine at one size is now the bottleneck. That may need a larger project, which we will say so.

Why generated ORMs and fast products hit the database wall early

Assistants will generate a convenient query or an N+1 loop that looks clean in a repository and is ruinous with real data. Startups also skip indexes because the demo set is small. A Human First pass measures the actual plan and will not invent a timing number.

How to find a slow query before you rewrite the schema

A slow-query log and a plan are the start. Do not run a dangerous rewrite on production as a first experiment.

  • Turn to the slow-query log or the statement stats you already have

    Pick the query that burns the most time, not only the one someone mentioned in chat.

  • Read the plan

    A sequential scan, a bad join order, or a sort that spills should be visible.

  • Check locks and long transactions at the moment it hurts

    A blocked writer can look like a 'slow site.'

  • Count the queries on a single user action

    If a page issues dozens of almost-identical statements, that is a finding.

  • If you suspect corruption, stop and protect the data

    Do not 'optimise' first. Say so in the first message to us.

Recognize your situation? Message us, we will sort it out.

03

How DevHero fixes it

A senior specialist leads. AI is a tool. A human checks the result.

Slow queries look mysterious until you read the plan, the locks, and the volume. Then they are usually specific and fixable. You do not have to guess.

DevHero is Human First. A specialist reads the actual plans and traffic, then changes what is safe. AI may help us scan logs. A human expert checks that a 'faster' query is still correct.

AI may help us scan logs. A human expert checks that a 'faster' query is still correct.

How a typical weekday case moves

  1. 01Message received
  2. 02Specialist named
  3. 03Diagnosis
  4. 04Fix
  5. 05Human check
  6. 06Handover

How to get help with slow database queries

Write on WhatsApp or Telegram. We take hard data-layer work. We will not promise to 'optimise the whole database' in a day, and we will not invent timings.

  1. Tell us the engine and the symptom

    PostgreSQL, MySQL, or another, plus whether the pain is a page, a job, or a lock.

  2. A named specialist answers

    Within a minute you should see their name. They are alerted, and can be called if they do not respond.

  3. Find and improve the worst queries, in 24 hours when in scope

    A major migration is a complex project.

How DevHero tunes a slow database path

We look at logs, plans, indexes, locks, and the application path, then change what is safe. A human checks that the faster query is still correct.

We look at slow query logs, plans, indexes, locks, and the application path that issues them. Then we fix the query, the index, or the pattern that dominates. A major migration or a new store is a complex project. We do not promise to 'optimise the whole database' in a day, and we do not invent timing numbers we have not measured.

  1. Identify the statements that dominate time

    Tied to a user action if we can.

  2. Change the query, the index, or the access pattern

    The smallest safe move that addresses the plan.

  3. Check correctness, not only duration

    A faster wrong total is not a result.

  4. Relieve locks and pool pressure if that is the issue

    Sometimes the 'slow query' is a blocked one.

  5. Recommend, rather than sneak in, a large schema change

    If that is what is really needed.

What you get in the first 24 hours on a database performance case

For a typical weekday case in scope, the aim is the worst queries improved and a clear leftover, not a new database product.

  1. A named set of statements or locks that dominate.

  2. A safe improvement applied or ready, with a rollback in mind.

  3. Measured timings from your system, not invented ones.

  4. A human-checked result.

  5. A note if a migration or a new store is the real next work.

What to send us about a slow or troubled database

Plans and logs help. Do not paste production passwords into the chat. If you suspect corruption, say so first.

The engine and the version if you know it

Plus hosted or self-managed.

The slow action

A URL, a job name, or a report.

Slow-query logs, plans, or screenshots of wait events

Whatever you already have.

Whether this might be corruption, not only slowness

That changes the first move.

A recent schema or ORM change

A new index drop, a migration, or a generated query.

Quick and urgent fixes

First 4 hours with a specialist + unlimited AI: free, once per client. Further work is paid, on request. A human leads and checks the result.

Free (first session)

Complex projects

Larger work uses a different rate, on request. We say so before we continue.

On request

Weekdays, then weekends

The base plan is weekdays only. Weekend work is a separate product. Any surcharge is stated up front, before any call, and depends on complexity. Amount: on request.

On request

The first session is free: the first 4 hours with a specialist, plus unlimited AI, once per client. Work beyond that, the complex-project rate, and the weekend rate are paid, on request.

One free session per client: the first 4 hours with a specialist, plus unlimited AI as a tool.

Recognize your situation? Message us, we will sort it out.

04

Stay fixed

What not to do next, the stacks we see in this kind of work, and how to keep the fix in place.

What not to do when the database is slow

A reckless migration can turn a slow afternoon into a data incident.

Rewriting the schema in production without a plan

Some of the best first moves do not need a dangerous migration.

Adding a dozen indexes 'just in case'

You can slow writes and still miss the query that matters.

Killing sessions at random

You may interrupt the only backup or the only long-running job you needed.

Ignoring backup status because you are focused on speed

Especially if you then try a rewrite.

Letting an assistant 'optimise all queries' in one pass

You need the plans, not a bulk rewrite you cannot review.

Databases and access layers we see in slow-query work

Tell us the engine. If we should not take it, we will say so.

PostgreSQL and MySQL, commonly

And similar relational engines.

ORMs and query builders

Prisma, Django ORM, Eloquent, Active Record, and others that hide N+1 patterns.

Hosted database products

When the limit is connections, IOPS, or a tier, not only SQL.

Jobs and reporting stacks

The batch that fights the website.

How to keep queries fast after the fix

A fixed plan stays a fixed plan only if the next feature is reviewed the same way.

Right after the fix

Watch the slow-query log and the wait events

Not only CPU.

Review new list and search features for unbounded queries

Pagination is not optional forever.

Do not drop an index as a cleanup without checking the plan

Yesterday's index may still be in use.

Keep transactions short

Do not hold a lock while you call a remote API.

As you keep shipping

Size the pool on purpose

Defaults are often wrong.

Treat generated queries as untrusted until you see a plan

A tidy repository is not a tidy plan.

Test a restore occasionally

Especially if you might later need a migration.

If slowness returns, measure again

Do not re-apply the last trick by memory.

Recognize your situation? Message us, we will sort it out.

05

Questions about this problem

Straight answers about this problem, the session, and what happens next.

Which databases do you work with?

PostgreSQL and MySQL are common, and others may be in scope. Tell us the engine in the first message.

Will you change production schema in the first hour?

Only with a clear, safe plan and your agreement. Some of the best first moves do not need a dangerous migration.

What about data corruption, not only slowness?

Say that up front. Corruption is an incident: we start with safety and backups, not with a casual rewrite.

How do I start?

Write on WhatsApp or Telegram. No form, no web chat.

Will you invent a speed-up percentage?

No. We will talk about what we measured on your system.

Is this the same as a generally slow website?

They overlap. This page is for the data layer. The slow-app page starts from the user path, which may still end here.

Can a full migration be done in 24 hours?

Not as a default. A typical session targets the worst queries. A major migration is a complex project.

Our database is a huge vendor warehouse. Can you help?

Tell us which one. If we should not take it, we will say so.

Do you take every reporting request?

No. We take hard technical bottlenecks, not every new dashboard idea.

What if the 'database slowness' is actually a missing timeout in the app?

Then we will say so and fix the actual constraint. Honesty about the layer is part of the work.

Is the first session really free?

Yes. Each client gets one free session: the first 4 hours with a specialist, plus unlimited AI as a tool. The 24-hour line is how quickly we aim to start and close a typical weekday case in scope, not 24 hours of unpaid work. Further work is paid, on request.

Human First

Slow database queries are holding the product back. We fix it within 24 hours.

If the product already waits on the database, write on WhatsApp or Telegram. You will talk to a person.

One free session per client: the first 4 hours with a specialist, plus unlimited AI as a tool.

Human First

Choose a channel

No web form, no web chat. Write on WhatsApp or Telegram and a specialist replies. Your message is prefilled with the problem and the page.

Telegram opens the chat with @brnzai. It may not paste this text automatically — copy it and send it there: