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 1gYAPc-0003dU-GC for pgsql-admin@arkaria.postgresql.org; Sat, 15 Dec 2018 13:55:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gYAPa-0004Tq-Bo for pgsql-admin@arkaria.postgresql.org; Sat, 15 Dec 2018 13:55:22 +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 1gYAPZ-0004Tj-Bp for pgsql-admin@lists.postgresql.org; Sat, 15 Dec 2018 13:55:21 +0000 Received: from mx2a.mailbox.org ([2001:67c:2050:104:0:2:25:2] helo=mx2.mailbox.org) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gYAPV-0001S0-ED for pgsql-admin@lists.postgresql.org; Sat, 15 Dec 2018 13:55:19 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 16A70A1039; Sat, 15 Dec 2018 14:55:11 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id YmLkNSOH8X-C; Sat, 15 Dec 2018 14:55:08 +0100 (CET) Message-ID: Subject: Re: finding queries doing sequential search From: Laurenz Albe To: wambacher@posteo.de, pgsql-admin@lists.postgresql.org Date: Sat, 15 Dec 2018 14:55:07 +0100 In-Reply-To: <6dd2fe53-a93d-a2ca-05aa-325921333dac@posteo.de> References: <6dd2fe53-a93d-a2ca-05aa-325921333dac@posteo.de> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk wambacher@posteo.de wrote: > i have a very big table (PostGIS OpenStreetMap data, but that does not mapper) > with about 380 million records and a size of 275 GB + Indices. > Permanently updated and growing. > Of course i enabled autovacuum. > The log shows me 8.2 Mio index scans (iscan), which is fine, and right now > 424 sequential scans (sscan) for planet_osm_polygon. see attached image. > I want to locate the query doing this stuff but EXPLAIN won't help because > most querys are dynamicly created. > Is there a way/trick do this? With a big table it shouldn't be a problem. Set log_min_duration_statement = 10000 or similar, and all long running statements will be logged. The sequential scans should be among them. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com