Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1itUOi-0000fH-0w for pgsql-jdbc@arkaria.postgresql.org; Mon, 20 Jan 2020 10:35:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1itUOg-0008H4-2j for pgsql-jdbc@arkaria.postgresql.org; Mon, 20 Jan 2020 10:35:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1itUOe-0008Gx-W7 for pgsql-jdbc@lists.postgresql.org; Mon, 20 Jan 2020 10:35:05 +0000 Received: from out-25.smtp.github.com ([192.30.252.208]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1itUOY-0007jK-Pi for pgsql-jdbc@lists.postgresql.org; Mon, 20 Jan 2020 10:35:03 +0000 Date: Mon, 20 Jan 2020 02:34:57 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1579516497; bh=xi3zBZPBBPRRzSwwRtuF9nXhxvd1magTHiNfrd2cj8A=; h=Date:From:To:Subject:From; b=iKU9nh7i32UwH4gGwbzGj9clTRIdX3z4iya54QQDUxI9ut7oc6RXet7Y8wlVgcKJK ZkHwRaDeWCGMXhygXqhB+iEHJG/BT1SrIv1GklBsBnyKHvROAeZiTDfUPydPVhRrzK RDYD678nn0qrSIrhlRdw5an899bmWUqVlosniz6U= From: bjanczak To: pgsql-jdbc@lists.postgresql.org Message-ID: Subject: [pgjdbc/pgjdbc] c57414: Metadata queries improvements. (#1673) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Approved: 58GruLoMopuc X-GitHub-Recipient-Address: pgsql-jdbc@lists.postgresql.org X-Auto-Response-Suppress: All List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Branch: refs/heads/master Home: https://github.com/pgjdbc/pgjdbc Commit: c574147af450fdac4a222dceef21991a67235396 https://github.com/pgjdbc/pgjdbc/commit/c574147af450fdac4a222dceef21991a67235396 Author: bjanczak Date: 2020-01-20 (Mon, 20 Jan 2020) Changed paths: M pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java Log Message: ----------- Metadata queries improvements. (#1673) * Metadata queries improvements. When dealing with large PostrgeSQL databases of thousands of schemas, tens of thousands of tables and millions of indexes particular PgDatabaseMetaData methods have suboptimal implementation. The pattern that was utilized in implementation used inner query on pg_catalog.pg_index in order to retrieve keys (information_schema._pg_expandarray(i.indkey) AS keys). Such implementation forced full table scan on pg_catalog.pg_index prior to filtering result set on schema and table name. The optimization idea was to get rid of inner querry in order to let querry planner to avoid full table scan and filter out pg_catalog.pg_index rows prior to executing (information_schema._pg_expandarray(i.indkey) AS keys). * checkstyle fixes