Skip to content

Design a powerful & modern SQL debug page  #5

@dgrelaud

Description

@dgrelaud

Draw an HTML admin page for EFIK which provide this feature.

  • possibility to see all requests (SQL and HTTP) without details (ex. one line per request with execution time).
  • One color per line type (HTTP inbound, SQL query, HTTP outbound, ...), Or one dynamic color per request id to see all consequences of a request ?
  • possibility to filter and see only SQL queries, or only inbound HTTP request, only outbound HTTP requests...
  • possibility to see without clicking on the line:
    • the full URL for HTTP
    • an extract of the SQL query?
    • the execution time
    • an icon to see if it hits the cache
  • highlight request with a {{PRINT}} inside
  • possibility to see intermediate CTE results
  • possibility to see execution plan (use ANALYZE JSON, use extension auto_analyze) !
  • Show tips to optimize requests:
    • detect Index Scan without Condition in PG plan -> means Seq Scan (https://explain.depesz.com/s/6OXV)
    • detect bad trigger (parallel, cost, executed each time, ...)
    • detect multiple update of the same row (SQL)
    • detect bad index usage (compare WHERE close with index, menu_set_date vs menu_get_date ?)
  • The source of data are stored in log files (parsed like a CSV by efik in a streaming mode) -> we should be able to parse multiple gigabyte of log files.
  • Idea: Possibility to start a global BEGIN transaction and replay a request to see the progression between each optimizations?

https://www.postgresql.org/docs/14/auto-explain.html

TODO

Find how we activate this debug mode?
In debug mode, we log all request like without {{PRINT}}???

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions