Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gDV5N-0001RW-MS for pgsql-performance@arkaria.postgresql.org; Fri, 19 Oct 2018 13:45:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gDV5K-0005vE-L0 for pgsql-performance@arkaria.postgresql.org; Fri, 19 Oct 2018 13:45:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gDV5K-0005uv-7F for pgsql-performance@lists.postgresql.org; Fri, 19 Oct 2018 13:45:02 +0000 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gDV5G-0007Wn-IX for pgsql-performance@lists.postgresql.org; Fri, 19 Oct 2018 13:45:00 +0000 Received: by mail-io1-xd31.google.com with SMTP id s6-v6so12430390ioa.11 for ; Fri, 19 Oct 2018 06:44:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=AhN8GHhYTJUBDTwowpMCscJ2hMEd5a3o1zyHOMVq5Xo=; b=WIjbXDUT6V3GadwHDWJNYyMaXGQWK61XJoH8ojJa8t65rex5svXrWYmjWMQA3BZC2h fOPraH+SQ3mEQAFGcZAld+/W9TaXNG6ueR4Xotrx0+tg6UwZ0ChVDyxtTpYY82mCsZEa X5B8rfR3B4ctLXfCU0ymGTRoUNxQBMZGoYxqts3C7SG7/oS5p6cPzpgUtY1iFLqrxbba 8LCML51qZyHSqY835pfxJvs+6zsmbvNf1FNqwjTXZJMx94+2A3X35btzxenNK3LQsCWk PmCZsjXTVmonqSpektpq8RkRcnuNlVZsO9K0MSQ/dsFeEDDakPugzBpawyyhoaIXLPef uuQQ== 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:user-agent; bh=AhN8GHhYTJUBDTwowpMCscJ2hMEd5a3o1zyHOMVq5Xo=; b=gbnJzG0Fm7ZA8j1oaWuPEEeOkCUiCpxD4+Tp8FqjKmGiAhPw/twqRspxEI0GK+MFoN dAOAJYmQ4KMAtPs/dk3WYS+UrGiCKyUlgI5Q4u59uDjnWTVRK691RptDAsm2E1+z9v4P 9X+8/sGgOrJlyzC9fohO8QwGPzyiIVgzI8fekDYxBBRU9y+aR9GKamoaElToOeYbWYMv IdGp0xHVKuZYtImyWOVwj/9u6EBGhAen0gqd7y3tPMuMB6CqvUO9qkfd7Q+CxtLrXI++ lKMTQhRV2D9Rpu3lqBBBquXK1S8auRRTEUUHOdVHosI5iPv6fzHSMzinjHwqr73YPuyt H/rw== X-Gm-Message-State: AGRZ1gI9NARtOMexvKB6FPu7JYXjvN/5fYplk9464ty4e5miCUAwveEi ND2tN/9ooeK3towagFArO8jzJ3h0rp52GQ== X-Google-Smtp-Source: AJdET5ebmLC2dpr55QXqPf4Kl7b+w69Pr4aglk677nOAGZb5hoBK34Du02juQaNfrn/xJe0Td17b7A== X-Received: by 2002:a6b:b48d:: with SMTP id d135-v6mr2964105iof.166.1539956696776; Fri, 19 Oct 2018 06:44:56 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id w124-v6sm1721031ita.0.2018.10.19.06.44.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Oct 2018 06:44:56 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id 4653B804CE4; Fri, 19 Oct 2018 08:44:55 -0500 (CDT) Date: Fri, 19 Oct 2018 08:44:55 -0500 From: Justin Pryzby To: Yavuz Selim Sertoglu Cc: pgsql-performance@lists.postgresql.org Subject: Re: Gained %20 performance after disabling bitmapscan Message-ID: <20181019134455.GI24215@telsasoft.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Oct 19, 2018 at 07:19:12AM +0000, Yavuz Selim Sertoglu wrote: > I have a problem with my query. Query always using parallel bitmap heap scan. I've created an index with all where conditions and id but query does not this index and continue to use bitmapscan. So I decided disable bitmap scan for testing. And after that, things became strange. Cost is higher, execution time is lower. > But I want to use index_only_scan because index have all column that query need. No need to access table. > It is doing index_only_scan when disabling bitmap scan but I cannot disable bitmap scan for cluster wide. There are other queries... My first comment is that bitmap IOS is supported on PG11, which was released..yesterday: https://www.postgresql.org/docs/11/static/release-11.html |Allow bitmap scans to perform index-only scans when possible (Alexander Kuzmenkov) Also, I wonder whether parallel query is helping here or hurting (SET max_parallel_workers_per_gather=0)? If it's hurting, should you adjust cost parameters or perhaps disable it globally ? Justin