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 1iPpeX-00053R-Bx for pgsql-bugs@arkaria.postgresql.org; Wed, 30 Oct 2019 15:12:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iPpeW-0004NL-3J for pgsql-bugs@arkaria.postgresql.org; Wed, 30 Oct 2019 15:12: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_SHA1:256) (Exim 4.89) (envelope-from <9erthalion6@gmail.com>) id 1iPpeV-0004NE-RC for pgsql-bugs@lists.postgresql.org; Wed, 30 Oct 2019 15:12:51 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from <9erthalion6@gmail.com>) id 1iPpeT-00061U-T8 for pgsql-bugs@lists.postgresql.org; Wed, 30 Oct 2019 15:12:51 +0000 Received: by mail-wm1-x342.google.com with SMTP id c22so2593498wmd.1 for ; Wed, 30 Oct 2019 08:12:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=5+YFIdv3/Wxl6t++MwehjXHSkPg+QfIhOxPJvCBbSEg=; b=ZFYHIS8n93Jzo7V4ijkTngjQxmW6Vi8mGTczGdhhlXYH5NcYtLDi2eMoBeAJwP0ZcL fTS1hKtwrzOuE1kuYz43It+22ZMw40Tdn+EWHZI7kVokauOk/ThrDADj8jcHy8FWGtq3 On0nhJAxehM3autN2W4xXGYzWIJEypoxGw8X0cOLX05JZaTbUbp5A2P1T9X72Kmbr+XQ OCHMPRH9cyejRIvonOYNJA7w0QDMTrHVmp/vt5fYw8H6MEHpVD7wjlGdwpoGYDEX9a1m fjfkXY2jxuKVNkE6UfUJakBIT0auBkmCpJLbx/8BVk2RO3EKnf06JFJLTWzyq8A8YnYg UAEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=5+YFIdv3/Wxl6t++MwehjXHSkPg+QfIhOxPJvCBbSEg=; b=Uja7c61fTRhSrYJjdG2/IzcBBiB/IeDJ/JAAYw4JCRVy7yiN+cWektuDR3gePOfDJu XBn7cAYv109Y6xxgWA4AuKmvKKmxekcEoccLiIPjmnOwN+Gyc/sz1P4VPMpxoJE8M9Ce 24iFZOxXFSuZ25gD13Fid17aqhPhVIRHeTOzL4SAYET+mgyKrI8TbIfhffS+o9Jp9RNK 3VflIF6Yk2vY0ndR0XPCMRhtr8NxNDArMsODZEgr5eUpQj3SQwfIqf2ptH6mGAmI3uye wBGxRGe9T9LttaNKErbEszuFZb+ZDfh2w6GKTceg4Rkyig18QecZ9v4VInuKOhIBFWAn sVnw== X-Gm-Message-State: APjAAAWq1VHhNb0PDuRP76La5FpZju5t3oTfUkz9nc1iyeehT/2Jchet 5teBI+AEjLXVe735dqdBTms= X-Google-Smtp-Source: APXvYqzOo0bwdsfVDsW24LpmWitiV+4WRbK8J75gVGjo3XjKk+Evq6fMMjYh6WenvVpS0qE+gRxOqA== X-Received: by 2002:a05:600c:22c4:: with SMTP id 4mr9773998wmg.177.1572448369320; Wed, 30 Oct 2019 08:12:49 -0700 (PDT) Received: from localhost ([2a02:8109:9ac0:3777:f68c:50ff:fe28:e015]) by smtp.gmail.com with ESMTPSA id f204sm316173wmf.32.2019.10.30.08.12.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Oct 2019 08:12:48 -0700 (PDT) Date: Wed, 30 Oct 2019 16:14:39 +0100 From: Dmitry Dolgov <9erthalion6@gmail.com> To: Stepan Yankevych Cc: "stepya@ukr.net" , "pgsql-bugs@lists.postgresql.org" Subject: Re: BUG #16089: Index only scan does not happen but expected Message-ID: <20191030151439.gtfp77bef25za3n4@localhost> References: <16089-89312196238e2c78@postgresql.org> <20191030141316.lkzqxc5isoc4xbgz@localhost> <20191030151006.cja5q3hd6fclwuq4@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191030151006.cja5q3hd6fclwuq4@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On Wed, Oct 30, 2019 at 04:10:06PM +0100, Dmitry Dolgov wrote: > > On Wed, Oct 30, 2019 at 02:18:09PM +0000, Stepan Yankevych wrote: > > > > >> And in fact at least in my tests this was indeed faster > > Can you show execution plan when index is used? > > Does it uses Index only scan or index scan and table scan? > > Yes, at the bottom of the plan there was an Index Only Scan going > through l1_snapshot_201811 (although while populating the table I've set > values only for not nullable columns). To clarify, Index Only Scan was there only after changing random_page_cost/seq_page_cost. As I mentioned in the previous email, original plan was also parallel seq scan.