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 1hoWqr-0006jQ-4K for pgsql-general@arkaria.postgresql.org; Fri, 19 Jul 2019 17:39:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hoWqp-00030c-UL for pgsql-general@arkaria.postgresql.org; Fri, 19 Jul 2019 17:39:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hoWqp-00030V-HZ for pgsql-general@lists.postgresql.org; Fri, 19 Jul 2019 17:39:23 +0000 Received: from customer-185-24-169-24.ip4.gigabit.dk ([185.24.169.24] helo=mail.bunk.cc) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hoWqm-0004yK-B3 for pgsql-general@lists.postgresql.org; Fri, 19 Jul 2019 17:39:23 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.bunk.cc (Postfix) with ESMTP id 7FAB2B404BA for ; Fri, 19 Jul 2019 19:39:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bunk.cc; s=201907; t=1563557959; bh=QWxfBTFAtEfzLaZXRh+P+I5/OHvDEaN7lwx3undgnKg=; h=From:To:Subject:In-Reply-To:References:Date:From; b=VgxPtkLQZJ4lYsauIe9E0RqSAWZpsxe0bNZsgHaxBmepjbmXcZfAMidl0N6mjTSrc KExNK+ESH0MtDA6msDqsJ17ulGCa7YdLJ6OTKECtQErrT4f+FdASP3JNiRlYJO7Zjc 876WpYRtxwunKmCZ6+Mt9wYSbVfxKOfj04oMfTi5W2IuUWH88sz9r6eVPB6BYUYOph 8rB0qdg4CbdWcUTM+wSzdt8bBAsujOr2GTp6GFvQD2kTfIk+31CvIYGqrTD52fKiEm zp6qDWsMQkTFp7mybL2xdnNgCvYyzLFBc7fnhD49WfipyKTOkiMHAtE5WRGNf2OF5a sxyR+vteSoU1A== X-Virus-Scanned: Debian amavisd-new at atom.bunk.cc Received: from mail.bunk.cc ([127.0.0.1]) by localhost (atom.bunk.cc [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0mIwwiCyEgRP for ; Fri, 19 Jul 2019 19:39:17 +0200 (CEST) Received: from paven (unknown [10.168.1.1]) by mail.bunk.cc (Postfix) with ESMTP id 0AAF7B401C5 for ; Fri, 19 Jul 2019 19:39:16 +0200 (CEST) From: Jacob Bunk Nielsen To: pgsql-general@lists.postgresql.org Subject: Re: Rearchitecting for storage In-Reply-To: (Matthew Pounsett's message of "Fri, 19 Jul 2019 10:08:45 -0400") References: <20190718173424.GB25488@aart.rice.edu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) X-Hashcash: 1:20:190719:ktm@rice.edu::5ANjD4p9mRFF7N94:000003anl X-Hashcash: 1:20:190719:matt@conundrum.com::vfadTVJX0GEHPKZ8:00000000000000000000000000000000000000000005XBC X-Hashcash: 1:20:190719:robjsargent@gmail.com::5Z0VrNAfjZquVaem:0000000000000000000000000000000000000000BrSu X-Hashcash: 1:20:190719:pgsql-general@lists.postgresql.org::Ne6SWSF7xdC3soUI:000000000000000000000000000BqEi Date: Fri, 19 Jul 2019 19:39:16 +0200 Message-ID: <87blxpgbzv.fsf@paven.bunk.cc> MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Matthew Pounsett writes: > On Thu, 18 Jul 2019 at 19:53, Rob Sargent wrote: > > Can you afford to drop and re-create those 6 indices? > > Technically, yes. I don't see any reason we'd be prevented from doing that. But, rebuilding them will take a long time. That's a lot of downtime to incur any time we update > the DB. I'd prefer to avoid it if I can. For scale, the recent 'reindex database' that failed ran for nine days before it ran out of room, and that was in single-user. Trying to do > that concurrently would take a lot longer, I imagine. This may be a stupid question, but are you certain they are all used? It wouldn't be the first time that I've seen someone create indexes and then never use them. This script can tell you if there are any indexes that seems largely unused. https://github.com/pgexperts/pgx_scripts/blob/master/indexes/unused_indexes.sql If you can run your application without access to the indexes for a while you can create them concurrently in the background using "CREATE INDEX CONCURRENTLY ...". Best regards, Jacob