{% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} {% for category, message in messages %}
{{ message }}
{% endfor %} {% endif %} {% endwith %}

Table Details: {{ table.table_name }}

Back to Tables

Table Statistics

Total Queries

{{ table.total_queries }}

Read Queries

{{ table.read_queries }}

Write Queries

{{ table.write_queries }}

Total Time

{{ "%.2f"|format(table.total_time) }} ms

Time Distribution
Read operations: {{ "%.2f"|format(table.total_read_time) }} ms {{ "%.2f"|format((table.total_read_time / table.total_time) * 100) if table.total_time > 0 else 0 }}%
Write operations: {{ "%.2f"|format(table.total_write_time) }} ms {{ "%.2f"|format((table.total_write_time / table.total_time) * 100) if table.total_time > 0 else 0 }}%
Total time: {{ "%.2f"|format(table.total_time) }} ms 100%
Table Information
Table Name: {{ table.table_name }}
Read to Write Ratio: {% if table.write_queries > 0 %} {{ "%.2f"|format(table.read_queries / table.write_queries) }} : 1 {% else %} Read-only {% endif %}
Average Time per Query: {% if table.total_queries > 0 %} {{ "%.2f"|format(table.total_time / table.total_queries) }} ms {% else %} N/A {% endif %}
{% if queries %}

Related Queries

{% if queries.read %}
{% for query in queries.read %}
{{ query.id }}

{{ query.text }}

{% endfor %}
{% else %}
No read queries found for this table.
{% endif %}
{% if queries.write %}
{% for query in queries.write %}
{{ query.id }}

{{ query.text }}

{% endfor %}
{% else %}
No write queries found for this table.
{% endif %}
{% endif %}

Table Insights

Performance Insights
    {% if table.read_queries > table.write_queries * 5 and table.total_queries > 10 %}
  • This table is primarily used for reading ({{ table.read_queries }} reads vs {{ table.write_queries }} writes)
  • Consider adding appropriate indexes for frequent query patterns
  • If possible, this table could be a good candidate for caching or materialized views
  • {% elif table.write_queries > table.read_queries %}
  • This table has more write operations than reads ({{ table.write_queries }} writes vs {{ table.read_queries }} reads)
  • Consider optimizing write operations and checking for excessive updates
  • Be careful with adding too many indexes as they can slow down writes
  • {% else %}
  • This table has a balanced read/write pattern
  • Focus on optimizing the most expensive queries first
  • {% endif %} {% if table.total_time > 1000 and table.total_queries > 5 %}
  • This table consumes significant database time ({{ "%.2f"|format(table.total_time) }} ms)
  • Consider reviewing schema design and query patterns
  • {% endif %}
Recommendations
  • Review the data lineage graph to understand how this table connects to others
  • Check table statistics with ANALYZE {{ table.table_name }}
  • Review the table's indexes with \\d {{ table.table_name }} in psql
  • Consider partitioning if this is a very large table with distinct access patterns