The key question

A fast single query in a test environment does not prove an entire business process. Data distribution, concurrency, network latency and connection management all affect observed performance.

What to inventory

  • Prioritise business-critical queries and batch runs.
  • Capture data volume, distribution and typical parameter ranges.
  • Record response times and concurrency before migration.

Design the target deliberately

Establish functional correctness first, then investigate measured bottlenecks. EXPLAIN can inspect execution plans. EXPLAIN ANALYZE actually executes the statement, so writes or statements with side effects belong in a controlled test environment.

A concrete validation step

A useful measurement sheet records query ID, parameter class, data state, plan, runtime and rows processed. Without that context, two timings are difficult to compare.

Evidence required before sign-off

  • Compare results before and after optimisation.
  • Separate warm-cache and cold-start behaviour.
  • Test concurrency, locks and long transactions.
  • Document target values for critical business processes.

Primary sources & further reading

These recommendations are engineering guidance. Specific options depend on source and target versions, privileges and operating model.