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 1iCDgA-0005wX-02 for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Sep 2019 02:02:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iCDg8-0007a7-SZ for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Sep 2019 02:02:16 +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 1iCDg8-0007Zg-EE for pgsql-hackers@lists.postgresql.org; Mon, 23 Sep 2019 02:02:16 +0000 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iCDg5-0004nR-RY for pgsql-hackers@postgresql.org; Mon, 23 Sep 2019 02:02:15 +0000 Received: by mail-qk1-x741.google.com with SMTP id w2so13777081qkf.2 for ; Sun, 22 Sep 2019 19:02:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=nxwMZLp29/BIDQLenenXC/ZCOk+v90ULGr69a060c/4=; b=fmS+Hs5rsnwuAMZAifXhOvEeOYTBai95nYUTfUK0TdKmPCbQKuRxVrcs0bhaqwM5MM JmsT2fHE8STsJ8YkH5ilSdEupXwbRPvgLxW5i1MYXkzlLW3X8BRy/dw+jId4+n0LjFMC fwwI3mmRpN527J9ddhZ3ZWhZzcghoO03WGUAmugdD/UbmcTgH4z4DI7Q7Q+ZeeW3zrCu +7r5CKVtMr8a40XdN5lXz7vEHS78PT2NeyoqT1Jyo34kdNlQsPwgyftGl3Knlv/VIClC 60ZZ/FLivVjpqb7EwTFXkS+/z5L3hABlNdPx6FDBJGUOvSLSRFNBNNoCvuamK1MDGOpZ tgtg== 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:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=nxwMZLp29/BIDQLenenXC/ZCOk+v90ULGr69a060c/4=; b=VGjdzprb0JoGDDswPjojdSAi5n5o6xfnC5c6qW/Uxu/rW1BGTrmUMUaNP3zzYAWCTA yInfPw30l1b6EziC2QHbJFKihhPTbICwumumk8JSQ2Zb3ZT3U2UjE5IrRkLZiHSMx4NL hwv3lT9XSQgINgGd0AVylECTL5C1UX9apcCVjvGWdl3aZW2Mq1zA6Z1GdRgV5a28Rt95 QbuQ7yxCbbAh2TVyvnKTs8tDFicsWoiioozFVtAvxTGYnjMWUfVchMSka5ifE8Zn4syt J/kVp+ibbPo2UAAL4xOhDJh9PbJ1NXCsKJbj85dZqiRnhTSLMZIyJwgXxba0jTZfDlCE WJDA== X-Gm-Message-State: APjAAAXF0uo43ZeRSYWebG6GzzgdJBWgdeNNKDtTPiClY4a/sXpULAZm D4EQ/8vMUwPzsmtwwRlqF5mBoA== X-Google-Smtp-Source: APXvYqw2mWo9Pj6zOfCTbb4nyekTXOFjkWrz4ATKlTKM0GJdeyakW8ZiJDYe/L9DESOsMkbuLg247Q== X-Received: by 2002:a05:620a:65c:: with SMTP id a28mr15027914qka.4.1569204132492; Sun, 22 Sep 2019 19:02:12 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([177.154.139.202]) by smtp.gmail.com with ESMTPSA id i2sm5846973qti.58.2019.09.22.19.02.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Sep 2019 19:02:09 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 585191207A0; Sun, 22 Sep 2019 23:02:04 -0300 (-03) Date: Sun, 22 Sep 2019 23:02:04 -0300 From: Alvaro Herrera To: Dmitry Dolgov <9erthalion6@gmail.com> Cc: Floris Van Nee , Kyotaro Horiguchi , "jesper.pedersen@redhat.com" , David Rowley , Thomas Munro , James Coleman , Rafia Sabih , Jeff Janes , Peter Geoghegan , Tomas Vondra , Thomas Munro , Bhushan Uparkar , PostgreSQL-development , Alexander Korotkov Subject: Re: Index Skip Scan Message-ID: <20190923020204.GA2781@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Sep-22, Dmitry Dolgov wrote: > > I think multiplying two ScanDirections to watch for a negative result is > > pretty ugly: > > Probably, but the only alternative I see to check if directions are opposite is > to check that directions come in pairs (back, forth), (forth, back). Is there > an easier way? Maybe use the ^ operator? -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services