Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cM1W9-0007rg-Ka for pgsql-performance@arkaria.postgresql.org; Tue, 27 Dec 2016 23:50:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cM1W8-0007fX-UJ for pgsql-performance@arkaria.postgresql.org; Tue, 27 Dec 2016 23:50:52 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cM1W8-0007fH-7v for pgsql-performance@postgresql.org; Tue, 27 Dec 2016 23:50:52 +0000 Received: from mail-qt0-x231.google.com ([2607:f8b0:400d:c0d::231]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cM1W4-0008Ox-6c for pgsql-performance@postgresql.org; Tue, 27 Dec 2016 23:50:51 +0000 Received: by mail-qt0-x231.google.com with SMTP id d45so116542827qta.1 for ; Tue, 27 Dec 2016 15:50:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=OioslbjHDEANaMlyw/2dSjuMp48C/UYu9AKu00wZGG4=; b=jnaHwLWWEEJf8ddjMEAdFa3VsDvQg5nqi1/MIZ76bIZxXllriWVVvYt3SzGZSebYZI uNiZDfjLV+beCiatyhRUNGlwrwkWAnbCQ2BSqJBkAZdmtEvrcxIxOXn0LuicUT9Emgpf CBFEXIz6+qgUJwSCKmo0AXa/ipL0CHmhnb9QvT3Z9E1j3HPvh5BpHA4lrvWOEvMopKM5 qZ6PrkbbXrv0xuasKcLeZLqfyQEhauVDkALsnb2htbgugcpBD0z/jrnDcqwo5pVL+pXv fjvUIKSBFgOHOoDs4oa4n9+hXWJNUcBMiGZ/3idZcocs/laaNSX9I/t/RTg4aAIf0Ucp tjyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=OioslbjHDEANaMlyw/2dSjuMp48C/UYu9AKu00wZGG4=; b=hTcX2Ca3fXnGS+yjcZHedXf2pqsvCccI/uGkBB/vpQ475ZAYgnx6oC2edriTvpA1dh lRecx9D/u33TXIM33mNodxytXYHg5KXGOQSUvHTFqDJabtSOixqZ78go73mKlElRr7Pa 3oJDihwX0PlLRZFLxrtJJ1ZFbIxL/v15ezqBZts+gmlf+vcvPjf9sqiY8mu3vQ9G/GKi JmCgwzKS6bqlAEox2r59aKUgjsE0QpxOWRibiqsB9n77Y+IuqeULHMeJAHSppNMIbaWP HXB3MftBYDMQS426SYWjFD0iOR2kD4Cga8EayDwjsTXrAliAlTKJQkr5EInN8JpikDJ5 +0QQ== X-Gm-Message-State: AIkVDXLPHRbNTngIo0Yg3V/q6fz3huLTFZREC5ajfwRMswsjdSXYsr9lCl8EfOvcdl2QvEGNh6WlpIonJpewRw== X-Received: by 10.237.60.104 with SMTP id u37mr22140476qte.152.1482882646264; Tue, 27 Dec 2016 15:50:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.41.197 with HTTP; Tue, 27 Dec 2016 15:50:05 -0800 (PST) From: =?UTF-8?Q?Fl=C3=A1vio_Henrique?= Date: Tue, 27 Dec 2016 21:50:05 -0200 Message-ID: Subject: Slow query after 9.3 to 9.6 migration To: pgsql-performance@postgresql.org Content-Type: multipart/alternative; boundary=94eb2c19031c5fd12a0544ac85a6 X-Pg-Spam-Score: -2.7 (--) 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 --94eb2c19031c5fd12a0544ac85a6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi there, fellow experts! I need an advice with query that became slower after 9.3 to 9.6 migration. First of all, I'm from the dev team. Before migration, we (programmers) made some modifications on query bring it's average time from 8s to 2-3s. As this query is the most executed on our system (it builds the user panel to work), every bit that we can squeeze from it will be nice. Now, after server migration to 9.6 we're experiencing bad times with this query again. Unfortunately, I don't have the old query plain (9.3 version) to show you, but in the actual version (9.6) I can see some buffers written that tells me that something is wrong. Our server has 250GB of memory available, but the database team says that they can't do nothing to make this query better. I'm not sure, as some buffers are written on disk. Any tip/help will be much appreciated (even from the query side). Thank you! The query plan: https://explain.depesz.com/s/5KMn Note: I tried to add index on kilo_victor table already, but Postgresql still thinks that is better to do a seq scan. Fl=C3=A1vio Henrique --94eb2c19031c5fd12a0544ac85a6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi there, fellow experts!

I need an adv= ice with query that became slower after 9.3 to 9.6 migration.
First of all, I'm from the dev team.

Before migration, we (programmers) made some modifications on query brin= g it's average time from 8s to 2-3s.

As this q= uery is the most executed on our system (it builds the user panel to work),= every bit that we can squeeze from it will be nice.

Now, after server migration to 9.6 we're experiencing bad times with= this query again.

Unfortunately, I don't have= the old query plain (9.3 version) to show you, but in the actual version (= 9.6) I can see some buffers written that tells me that something is wrong.<= /div>

Our server has 250GB of memory available, but the = database team says that they can't do nothing to make this query better= . I'm not sure, as some buffers are written on disk.

Any tip/help will be much appreciated (even from the query side).

Thank you!


Note: I tried to add index on kilo_= victor table already, but Postgresql still thinks that is better to do a se= q scan.


Fl=C3=A1vio Henrique
--94eb2c19031c5fd12a0544ac85a6--