Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3GPF-0003ha-6L for pgsql-performance@arkaria.postgresql.org; Wed, 26 Apr 2017 06:26:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d3GPE-0005Z9-J6 for pgsql-performance@arkaria.postgresql.org; Wed, 26 Apr 2017 06:26:28 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d3GNT-0002LL-JJ for pgsql-performance@postgresql.org; Wed, 26 Apr 2017 06:24:39 +0000 Received: from smtp-4.sys.kth.se ([2001:6b0:1:1300:250:56ff:fea6:2de3]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d3GNN-00037u-MA for pgsql-performance@postgresql.org; Wed, 26 Apr 2017 06:24:38 +0000 Received: from smtp-4.sys.kth.se (localhost.localdomain [127.0.0.1]) by smtp-4.sys.kth.se (Postfix) with ESMTP id 306662454 for ; Wed, 26 Apr 2017 08:24:29 +0200 (CEST) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-4.sys.kth.se ([127.0.0.1]) by smtp-4.sys.kth.se (smtp-4.sys.kth.se [127.0.0.1]) (amavisd-new, port 10024) with LMTP id CXfuckGOzqv4 for ; Wed, 26 Apr 2017 08:24:28 +0200 (CEST) X-KTH-Auth: eskil [2001:6b0:1:11f0:6e62:6dff:fe6a:ffa3] DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kth.se; s=default; t=1493187868; bh=oe1SODxxBjwmyJIDCfAAmaQ03/DlVfXkP9dM/7BhXWA=; h=Subject:From:To:Date:In-Reply-To:References; b=NLhRwU91Yf3JCHtNnRj38/hGRlERfZX8E8KJ1HCmS40c/WOP/9vM/T2IUvFaiW1bl OjQUnm1koyTGlaxqSJi9NudgtsgUgL0Gz2B8oaB/qxi7enAeT7I7f4MALDkh5ke+aH TixMlznZ939Bw8N7AGnXkEJMeIwM4Zn2oCoILVjU= X-KTH-mail-from: eskil@kth.se X-KTH-rcpt-to: pgsql-performance@postgresql.org Received: from tiny.ite.kth.se (tiny.ite.kth.se [IPv6:2001:6b0:1:11f0:6e62:6dff:fe6a:ffa3]) by smtp-4.sys.kth.se (Postfix) with ESMTPSA id 23B6115 for ; Wed, 26 Apr 2017 08:24:27 +0200 (CEST) Message-ID: <1493187867.30225.3.camel@kth.se> Subject: Re: Slow query with 3 table joins From: Johan Fredriksson To: pgsql-performance@postgresql.org Date: Wed, 26 Apr 2017 08:24:27 +0200 In-Reply-To: References: Organization: KTH Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 (3.12.11-22.el7) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -4.3 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org tis 2017-04-25 klockan 23:19 -0400 skrev Alessandro Ferrucci: > After about 40 inutes the slow query finally finished and the result > of the EXPLAIN plan can be found here: > > > https://explain.depesz.com/s/BX22 > > > Thanks, > Alessandro Ferrucci I'm not so familiar with the index implementetion in Postgres, but I don't think it is very efficient to index a text-field. It also loooks a bit strange that a id-field has the datatype "text" rather than integer or varchar. / Eskil -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance