db.client.operation.duration
Database operation execution timeDimensions:None
Technical Annotations (82)
Configuration Parameters (19)
iterator.chunk_sizerecommended: 500pool_moderecommended: transactionmax_client_connrecommended: 500default_pool_sizerecommended: 25server_idle_timeoutrecommended: 600page_sizerecommended: 50statement_timeoutrecommended: 10000DATABASESDATABASES.default.ENGINErecommended: dj_db_conn_pool.backends.postgresqlDATABASES.default.CONN_MAX_AGErecommended: 0DATABASES.default.POOL_OPTIONS.POOL_SIZErecommended: 10DATABASES.default.POOL_OPTIONS.MAX_OVERFLOWrecommended: 5CONN_MAX_AGErecommended: 0wait_timeoutduration_threshold_msrecommended: 100transaction_duration_threshold_msrecommended: 1000NPLUSONE_DETECTOR.THRESHOLDrecommended: 5managerrecommended: FastCountManagerdjango.db.backendsrecommended: DEBUGError Signatures (8)
timeout errorslog patternConnection pool exhaustedlog patternDatabaseErrorexceptionno more connections allowed (max_client_conn)error codequery_wait_timeouterror codeconnection failed: connection to server at "...", port 6432 failed: ERROR: no more connections allowed (max_client_conn)error codeOperationalError: MySQL server has gone awayexceptiondeadlockexceptionCLI Commands (9)
python manage.py dbshelldiagnosticEXPLAIN ANALYZEdiagnosticSHOW PROCESSLISTdiagnosticSELECT * FROM pg_stat_activitydiagnosticfrom django.db import connection, reset_queries
reset_queries()
print(f"Total queries: {len(connection.queries)}")diagnosticSHOW POOLSmonitoringEXPLAIN ANALYZE SELECT * FROM orders ORDER BY created_at DESC LIMIT 50 OFFSET 0;diagnosticCREATE INDEX idx_orders_created_at ON orders(created_at DESC);remediationSELECT split_part(query, 'WHERE', 2) AS sql, COUNT(*) AS count FROM pg_stat_activity WHERE datname = '...' GROUP BY querydiagnosticTechnical References (46)
prefetch_relatedcomponentPrefetchcomponentSeq Scanconceptmodels.IndexcomponentDjango Debug Toolbarcomponentannotate()componentCountcomponentSumcomponentselect_related()componentprefetch_related()componentdjango-debug-toolbarcomponentPgBouncercomponentmax_connectionscomponent.iterator()componentserver-side cursorsconceptchunk_sizecomponentpaginationconceptORMcomponentorders modelcomponentOrder.objects.all()componentIndex Scanconceptsettings.pyfile pathdj_db_conn_poolcomponentpg_stat_activitycomponentDatabaseConnectionMiddlewarecomponentMIDDLEWAREcomponentCONN_MAX_AGEcomponentQuerySetcomponentTracedCursorWrappercomponentdb.slow_querycomponenttransaction.atomiccomponenttraced_atomiccomponentEXPLAINcomponentselect_relatedcomponentForeignKeycomponentQuerySet.count()componentFastCountManagercomponentDjango admincomponentFastCountQuerySetcomponentSQL joinconceptmany-to-many relationshipsconceptreverse foreign keyconceptSubquery()componentOuterRef()componentDjango REST FrameworkcomponentDATABASEScomponentRelated Insights (37)
Prefetch loads millions of related objects causing memory explosionwarning
▸
Missing database indexes cause 30+ second query times in productionwarning
▸
Django app consumes 100% CPU from infinite loops or full table scanscritical
▸
Annotated querysets with aggregates load massive result sets into memorywarning
▸
N+1 query pattern executes one query per object for related recordscritical
▸
PostgreSQL connection count exceeds limits causing memory exhaustionwarning
▸
Server-side cursors with iterator() hold long transactions causing lock contentionwarning
▸
Unpaginated queries on large tables cause expensive operationswarning
▸
Infrastructure-only monitoring misses Django application failureswarning
▸
PostgreSQL query spike causing checkout latency during peak trafficcritical
▸
N+1 query pattern degrading Django response timewarning
▸
Unpaginated list endpoints cause outage at scalecritical
▸
Missing index on ORDER BY column causes full table scan despite paginationwarning
▸
Missing query timeout allows indefinite hangs and connection pool exhaustioncritical
▸
DatabaseError during query or transaction operationscritical
▸
Default Django backend causes connection overhead under loadwarning
▸
Django connections remain idle indefinitely despite CONN_MAX_AGE settingcritical
▸
MySQL connection timeout causes 'server has gone away' errors during traffic spikescritical
▸
Django ORM generates duplicate queries causing high query counts per pagewarning
▸
N+1 query problem multiplies database queries per itemwarning
▸
Slow database queries exceed 100ms thresholdwarning
▸
Transaction deadlocks cause transaction rollbackcritical
▸
Long transactions exceed 1 second durationwarning
▸
Unindexed queries perform full table scanswarning
▸
Missing composite indexes on multi-criteria filterswarning
▸
Excessive joins from deep select_related chainingwarning
▸
Missing index on foreign keys in large tableswarning
▸
N+1 queries cause exponential database load as data scaleswarning
▸
Django QuerySet.count() becomes O(n) bottleneck on tables with millions of rowswarning
▸
Django admin becomes unusable due to count() on every list page for large tablescritical
▸
N+1 queries cause sluggish performance and scalability issueswarning
▸
Foreign key access without select_related causes N+1 querieswarning
▸
Many-to-many or reverse foreign key access causes N+1 querieswarning
▸
Aggregating related data in loops causes N+1 querieswarning
▸
Complex per-record calculations cause N+1 querieswarning
▸
Per-request database connections cause API latency under loadwarning
▸
Database bottleneck causes response time spikes during high trafficwarning
▸