From patchwork Sun Dec 8 18:35:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niko Mauno X-Patchwork-Id: 180968 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp3449522ile; Sun, 8 Dec 2019 10:41:05 -0800 (PST) X-Google-Smtp-Source: APXvYqzmIvH78ekM2P1SCev9BefwsLhwtb2eXJPFIp9ERIo3MfluSAnWaYoE0XwbwAXyGSLJjMvS X-Received: by 2002:a17:90a:77c5:: with SMTP id e5mr10227789pjs.83.1575830465214; Sun, 08 Dec 2019 10:41:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575830465; cv=none; d=google.com; s=arc-20160816; b=AOwfDE43jW2sHpoSsk3CjQNcEOsBiSumILgoZmGV/3/CAnf/YINLOLTBRwY9E6MUbL ONzmQSgiUsNvZxl5dqaCS0IeQDkszOlIsTjWay1b916yGRSXwFraNVhYygOhHUO0AQuN iFi78M3Kjge3DIJhJjFZ5zyVUjP9UyVwcTbKuPXf0Q963bKyRlDXK2mwfJ+RCpdgCxRM T3Ke1XfJed8nMsEJeBxmjCv9eB6tXyWCj6q4p6uyQ2MpfPq3ea8N8Kzzd9I0QC7yQ9l2 vycvmwiVp7Ru/JrYoLQ81LyWi25VA0lpUFmBWLnU4gJ/c22EewdggyYe3Ro35UAzaExe 1Fog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=WlRYfH2Hf5QFw6TWVtPe5W5TC0Zt+tqkeWgD2JQTuBI=; b=r0XcVSu/cp7ebzvm+vQCVwtMSSxeAJgYbKvciTNBt7I74ntIooWjXLo4P57FGT8vwO 4X4HTUd4BEzbtjowkUEeUyrV3oE/I/YOWfPvf2EBFSPpKxuuRVQJoueqVT1/8cdukjcs RDLFvhiVjbWbc1vmw3AWekdT3DddcM9sNR1VTzSw2osmdl2+2SHpS2f+obIp7L68R9oy yBIsg1HXZBT0bymY4F3A7Wq2HgPX3YseH44jSDGDUZw9cmKHPuF4IO2irhsoieZIbiB5 wfgcX+r+xu9zir177VVjSAI5uHQK9FH/zuTI23kx9TfFr+SZm1jtX9pQc4JPMNNNIXgp 0RGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=iki.fi Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id m4si12924440pga.92.2019.12.08.10.41.04; Sun, 08 Dec 2019 10:41:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=iki.fi Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 27FD27FACA; Sun, 8 Dec 2019 18:41:02 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from sypressi2.dnainternet.net (sypressi2.dnainternet.net [83.102.40.154]) by mail.openembedded.org (Postfix) with ESMTP id 313E07F7B3 for ; Sun, 8 Dec 2019 18:40:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by sypressi2.dnainternet.net (Postfix) with ESMTP id DFD31149A7; Sun, 8 Dec 2019 20:40:43 +0200 (EET) X-Virus-Scanned: DNA Internet at dnainternet.net X-Spam-Flag: NO X-Spam-Score: 0.653 X-Spam-Level: X-Spam-Status: No, score=0.653 tagged_above=-9999 required=6 tests=[SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.652] autolearn=disabled Received: from sypressi2.dnainternet.net ([83.102.40.154]) by localhost (sypressi2.dnainternet.net [127.0.0.1]) (DNA Internet, port 10041) with ESMTP id L64765v49E4D; Sun, 8 Dec 2019 20:40:43 +0200 (EET) Received: from luumupuu2.dnainternet.net (luumupuu2.dnainternet.net [83.102.40.55]) by sypressi2.dnainternet.net (Postfix) with ESMTP id 7D55114E96; Sun, 8 Dec 2019 20:40:43 +0200 (EET) Received: from localhost.localdomain (62-78-161-185.bb.dnainternet.fi [62.78.161.185]) by luumupuu2.dnainternet.net (Postfix) with ESMTP id A1D5D74; Sun, 8 Dec 2019 20:40:38 +0200 (EET) From: Niko Mauno To: openembedded-core@lists.openembedded.org Date: Sun, 8 Dec 2019 20:35:53 +0200 Message-Id: <20191208183557.32589-7-niko.mauno@iki.fi> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191208183557.32589-1-niko.mauno@iki.fi> References: <20191208183557.32589-1-niko.mauno@iki.fi> MIME-Version: 1.0 Subject: [OE-core] [thud-next][PATCH 07/11] cve-update-db-native: add an index on the CVE ID column X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org From: Ross Burton Create an index on the PRODUCTS table which contains a row for each CPE, drastically increasing the performance of lookups for a specific CVE. (From OE-Core rev: b4048b05b3a00d85c40d09961f846eadcebd812e) Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/recipes-core/meta/cve-update-db-native.bb | 3 +++ 1 file changed, 3 insertions(+) -- 2.20.1 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-core/meta/cve-update-db-native.bb b/meta/recipes-core/meta/cve-update-db-native.bb index c15534de08..08b18f064f 100644 --- a/meta/recipes-core/meta/cve-update-db-native.bb +++ b/meta/recipes-core/meta/cve-update-db-native.bb @@ -120,11 +120,14 @@ python do_populate_cve_db() { def initialize_db(c): c.execute("CREATE TABLE IF NOT EXISTS META (YEAR INTEGER UNIQUE, DATE TEXT)") + c.execute("CREATE TABLE IF NOT EXISTS NVD (ID TEXT UNIQUE, SUMMARY TEXT, \ SCOREV2 TEXT, SCOREV3 TEXT, MODIFIED INTEGER, VECTOR TEXT)") + c.execute("CREATE TABLE IF NOT EXISTS PRODUCTS (ID TEXT, \ VENDOR TEXT, PRODUCT TEXT, VERSION_START TEXT, OPERATOR_START TEXT, \ VERSION_END TEXT, OPERATOR_END TEXT)") + c.execute("CREATE INDEX IF NOT EXISTS PRODUCT_ID_IDX on PRODUCTS(ID);") def parse_node_and_insert(c, node, cveId): # Parse children node if needed