{
  "id": "python/django-orm-query-timeout",
  "signature": "django.db.utils.OperationalError: query timeout expired",
  "signature_zh": "数据库操作错误：查询超时",
  "regex": "django\\.db\\.utils\\.OperationalError:\\ query\\ timeout\\ expired",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "数据库查询执行时间超过配置的超时限制",
  "root_cause_type": "generic",
  "root_cause_zh": "复杂的ORM查询或数据库性能问题导致查询耗时过长",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "可能掩盖性能问题，且数据库可能无法支持更长超时",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "查询结果不完整，功能失效",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Article.objects.select_related('author').filter(...)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "在模型字段上添加db_index=True",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.84,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-07-25",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}