From patchwork Fri Nov 22 11:39:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anuj Mittal X-Patchwork-Id: 180057 Delivered-To: patch@linaro.org Received: by 2002:ac9:2f4d:0:0:0:0:0 with SMTP id c13csp93180ocg; Fri, 22 Nov 2019 03:41:04 -0800 (PST) X-Google-Smtp-Source: APXvYqz0Oqoe9Wp6QzokTB+FcA3AvtOrj5S8CbLmeWHTY5fhpAW65XrpVjw2H4StzCcNNBXNVtYh X-Received: by 2002:a65:5542:: with SMTP id t2mr15143706pgr.74.1574422863497; Fri, 22 Nov 2019 03:41:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574422863; cv=none; d=google.com; s=arc-20160816; b=PkRojaOqWj/jltUJ5/clKQbllI6FoRCXBva/9H0Q71KLWThVMIw34ELYAv29y34YiS Q492Ed2+eW/KwKWd4z5nScfIdMZdgmQoWpQW8lIPitSeJi3sQTSvIIcw0BHIv9z8rc4V bMXzrGOJSpgf7H5H4u665Ax9q5az078Ac73ytN0Q5xYk25UaBhuMCu9s/mcmr9sOPnxt LfgsrI1bQwFGa4rutUZDrMOWoQ0/E4CYhq/xzFkAVO/Ajg+gy72wwOYFiin9AqeJXbn+ b2lVNM6LOOEt62gduKwG1fwJUhPetroOKtwiorTorPh4EX6ZJqtBh8MGNMdF495DLxec i1CA== 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=kVbJg8g8WYSXtwr1ONL+y0ze2+X4/yyJc5VIyf75xpo=; b=NryROsvnqBapWfNTIqz8cbTzw6WrrZbhOA61UjHOqV24NKXImnB5hBH/YP4ggDunEG IJeSaxs9bIAxfske0Zm2XVGxajeWT0UuXJgpdy+8LdWnNq6e6oV0aJz6iIY57trEP1fL F0Z8MxpemFD56CTdGb3w8+4ABTdJ/OZcKVuaNWBwGOSSxBnxQxLshbu2uCBdl3ZL/vOz Pz4HNFiuL5NqHMvMelPS6tzM91sxgOh9f3Em4TC4pGTE22Z5fHd0/GQCBStvL5j3GcST 2qVQUcDZkjzYMoosSoVOlngt9j+3g7LqV1nqAzKwpCfnzQBmsYuVyx6I46LwhaPQ20Je 53cA== 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=intel.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id 204si3378179pfa.194.2019.11.22.03.41.03; Fri, 22 Nov 2019 03:41:03 -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=intel.com 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 0E2087FCF1; Fri, 22 Nov 2019 11:40:37 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mail.openembedded.org (Postfix) with ESMTP id 34C977FCCD for ; Fri, 22 Nov 2019 11:40:18 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Nov 2019 03:40:19 -0800 X-IronPort-AV: E=Sophos;i="5.69,229,1571727600"; d="scan'208";a="201485334" Received: from anmitta2-mobl1.gar.corp.intel.com ([10.255.164.245]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Nov 2019 03:40:17 -0800 From: Anuj Mittal To: openembedded-core@lists.openembedded.org Date: Fri, 22 Nov 2019 19:39:05 +0800 Message-Id: <9092fb0fc978e0d1123195d8f18b28b5bcf6dce2.1574422359.git.anuj.mittal@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Subject: [OE-core] [zeus][PATCH 06/15] 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 Signed-off-by: Anuj Mittal --- meta/recipes-core/meta/cve-update-db-native.bb | 3 +++ 1 file changed, 3 insertions(+) -- 2.21.0 -- _______________________________________________ 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