Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5a5T-0004SN-7r for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Sep 2018 17:28:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5a5Q-0005uw-BS for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Sep 2018 17:28:24 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5a5P-0005up-UL for pgsql-hackers@lists.postgresql.org; Thu, 27 Sep 2018 17:28:24 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g5a5N-000593-42 for pgsql-hackers@postgresql.org; Thu, 27 Sep 2018 17:28:22 +0000 Received: by mail-pf1-x443.google.com with SMTP id k21-v6so2369415pff.11 for ; Thu, 27 Sep 2018 10:28:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=BcJd+0pUU7AVQ26oveJ2LrkcYJQd9VFnpd6X4aBBVPU=; b=tG9V1U3S3c75LFbzuanos20/Pqvd3zBv2yiEhFhRh83pjKe/Q9qJXqFoZnUzZvg6zq P8tOwgOndaGlR5veY+/BIe12ZnPVjPOs5lnIiWdMPmsDz3/m5tKjN1pwWXFQ+qZd5pAt LsMpOcFwjs4dk4RDqcZ4AfXOvADqyk7HViP3i04oEkYN3N6kL0LywLlmjx5cIkMV6WFM ZnKigjUFbwZhpJg2S5JStfogi6RCcU1WrfMPeOJqqhPOKzXO928zpJ1cqimWtOvB2nKZ 4qC647pvtqemHwQrZHo343Knou1Ptez9EB6BDk4SfjuNUvE9bBzyuzs1w+zxceov5wus GVzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=BcJd+0pUU7AVQ26oveJ2LrkcYJQd9VFnpd6X4aBBVPU=; b=WJ40jvLlfUhSwn5MM5tgzGkAJLDNlSyc035RNlhV39Tfiecv1HDiXcyJSLIkMqyuqK E7o8dIzU9NTn94u7+gOVLWNLjc46UCqeTTYWoeUqpcx3yWddpAtKJXRb2BJ5IFQWr5ox 7mEmxosHcPK8zeC91dINTMbeMqzdIcLPYwkpDyUc8Lv63S2sC5phVQIu0zl8jkFfxp/H GhsOCXqs9mBcSSnA4mRPax8ln3BXjnDjJXbeWpoSJxDjoNEn1pCcUpn9Ftdd4WXwHsdZ lmMxVV18ZsBFkRHII12Dr3xrLegHEB3z76hb7K0H2S+pVPJ/wArMnM1bQbPBiN38EaPZ woUg== X-Gm-Message-State: ABuFfojPOOurVR0rm7nn6W5dWpBeAJSqKk923QdL8YJG9t6VKyxLscfY UxIlCZLPzl4A8RDO12EL9bE= X-Google-Smtp-Source: ACcGV62YH4XOHTFp/ybeC4Hf0vX0hu/y4sFO/NbNtxvUpC0DQW0+WbqgW2W70ylmSCe1HfrV6K0syg== X-Received: by 2002:a62:6d02:: with SMTP id i2-v6mr12790453pfc.218.1538069299463; Thu, 27 Sep 2018 10:28:19 -0700 (PDT) Received: from [192.168.2.121] (24-113-198-17.wavecable.com. [24.113.198.17]) by smtp.gmail.com with ESMTPSA id x4-v6sm3672458pfm.119.2018.09.27.10.28.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Sep 2018 10:28:19 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: [HACKERS] [PATCH] kNN for SP-GiST From: Mark Dilger In-Reply-To: Date: Thu, 27 Sep 2018 10:28:16 -0700 Cc: Andrey Borodin , Nikita Glukhov , David Steele , Andres Freund , pgsql-hackers Content-Transfer-Encoding: quoted-printable Message-Id: References: <570825e8-47d0-4732-2bf6-88d67d2d51c8@postgrespro.ru> <43c859f9-cb0d-1bd2-ba9f-c5e5b61185cc@postgrespro.ru> <20180302063548.7ojyn56xd4ptc36v@alap3.anarazel.de> <6a09b16a-0b93-6fb1-c14a-7797477c5f38@postgrespro.ru> <01432E05-D1AD-4D80-A7B4-149A299E906B@yandex-team.ru> <13EDC8D7-A7DA-47ED-80B8-B48E01023633@yandex-team.ru> <8d429bed-1a7f-d592-7e13-03e99defde03@postgrespro.ru> <5A8DAE0D-E4E8-48A6-BC8C-048A240875A0@yandex-team.ru> <944a7113-1886-ee4e-b8e6-df3e4dbca02e@postgrespro.ru> To: Alexander Korotkov X-Mailer: Apple Mail (2.3445.9.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On Sep 18, 2018, at 3:58 PM, Alexander Korotkov = wrote: >=20 > On Mon, Sep 17, 2018 at 12:42 PM Andrey Borodin = wrote: >>> 17 =D1=81=D0=B5=D0=BD=D1=82. 2018 =D0=B3., =D0=B2 2:03, Alexander = Korotkov =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0= =BB(=D0=B0): >>>=20 >>> Also, it appears to me that it's OK to be a single patch >>=20 >> +1, ISTM that these 6 patches represent atomic unit of work. >=20 > Thank you, pushed. One note on this commit, in my fork, I have converted BoxPGetDatum from a macro to a static = inline function, and it shows a thinko in your commit, namely that in->leafDatum is of = type (BOX *), but is actually (as the name implies) already a Datum: spgquadtreeproc.c:469:27: error: incompatible integer to pointer = conversion passing 'Datum' (aka 'unsigned long') to parameter of type = 'BOX *' [-Werror,-Wint-conversion] = BoxPGetDatum(in->leafDatum), true, I'm not claiming this creates any active bug, just that it would make = more sense to handle the typing cleanly. Perhaps the following: diff --git a/src/backend/access/spgist/spgquadtreeproc.c = b/src/backend/access/spgist/spgquadtreeproc.c index dee438a307..90cc776899 100644 --- a/src/backend/access/spgist/spgquadtreeproc.c +++ b/src/backend/access/spgist/spgquadtreeproc.c @@ -465,8 +465,7 @@ spg_quad_leaf_consistent(PG_FUNCTION_ARGS) =20 if (res && in->norderbys > 0) /* ok, it passes -> let's compute the distances */ - out->distances =3D spg_key_orderbys_distances( - = BoxPGetDatum(in->leafDatum), true, + out->distances =3D = spg_key_orderbys_distances(in->leafDatum, true, = in->orderbys, in->norderbys); mark=