From patchwork Wed Jan 24 11:09:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 1890191 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="key not found in DNS" header.d=that.guru header.i=@that.guru header.a=rsa-sha256 header.s=x header.b=RtHqBNuo; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TKh7l6DFcz23dy for ; Wed, 24 Jan 2024 22:10:11 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" header.d=that.guru header.i=@that.guru header.a=rsa-sha256 header.s=x header.b=RtHqBNuo; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4TKh7l1MSxz3byh for ; Wed, 24 Jan 2024 22:10:11 +1100 (AEDT) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" header.d=that.guru header.i=@that.guru header.a=rsa-sha256 header.s=x header.b=RtHqBNuo; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=that.guru (client-ip=136.175.108.251; helo=mail-108-mta251.mxroute.com; envelope-from=stephen@that.guru; receiver=lists.ozlabs.org) Received: from mail-108-mta251.mxroute.com (mail-108-mta251.mxroute.com [136.175.108.251]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4TKh7c312qz30fh for ; Wed, 24 Jan 2024 22:10:03 +1100 (AEDT) Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta251.mxroute.com (ZoneMTA) with ESMTPSA id 18d3b298d8f0003727.002 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 24 Jan 2024 11:09:55 +0000 X-Zone-Loop: be4a78f1b82d5a987cae2a51310ad02e849c72867280 X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To: From:Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=2rcG5SuKL2KfoR88853bz4ZQUdZVNt6ZiK0xP18Ei7M=; b=R tHqBNuoUKSD1GtHZRgq8wVlBZCDAn1TpITaYFOo8ovQ8fHBn5wZmmHg3hSZDVv4xxYh+tIhY+3V1N ecZJSNSGAB3WCY5i/+KQsXTFkRJomFjrxvAPWQNxRS7wPf76DBno6GrZ5u7stHPZoZN0ijRiDGinJ ddC2Eon8AT32YfAv7P8ghPwxxQv3LUkGMRjMLg/k37IhlfLUQlscEWkoeN/GGlOSAMHsAUXpbiYs3 ZYNK/Lv+v9YVRo7UCirqG3Vfski1cte1U9EKBaOGZv4xCqCJVQVdT31kSGRdR844iN+z68J3Ywo9t yI6NhLBLpcBHBlAp7mrklxYjezh1GoAhw==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH] models: Add covering index for Patch.hash Date: Wed, 24 Jan 2024 11:09:46 +0000 Message-ID: <20240124110946.481812-1-stephen@that.guru> MIME-Version: 1.0 X-Authenticated-Id: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mauro Carvalho Chehab Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Signed-off-by: Stephen Finucane Closes: #579 Cc: Mauro Carvalho Chehab --- .../migrations/0047_add_database_indexes.py | 18 ++++++++++++++++++ patchwork/models.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 patchwork/migrations/0047_add_database_indexes.py diff --git a/patchwork/migrations/0047_add_database_indexes.py b/patchwork/migrations/0047_add_database_indexes.py new file mode 100644 index 00000000..42c11997 --- /dev/null +++ b/patchwork/migrations/0047_add_database_indexes.py @@ -0,0 +1,18 @@ +import patchwork.fields +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ('patchwork', '0046_patch_comment_events'), + ] + + operations = [ + migrations.AlterField( + model_name='patch', + name='hash', + field=patchwork.fields.HashField( + blank=True, db_index=True, max_length=40, null=True + ), + ), + ] diff --git a/patchwork/models.py b/patchwork/models.py index 9a619bc5..38b52b05 100644 --- a/patchwork/models.py +++ b/patchwork/models.py @@ -501,7 +501,7 @@ class Patch(SubmissionMixin): ) state = models.ForeignKey(State, null=True, on_delete=models.CASCADE) archived = models.BooleanField(default=False) - hash = HashField(null=True, blank=True) + hash = HashField(null=True, blank=True, db_index=True) # series metadata