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 1hjkuC-0000sy-HW for pgsql-performance@arkaria.postgresql.org; Sat, 06 Jul 2019 13:39:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hjkuA-0003I1-8f for pgsql-performance@arkaria.postgresql.org; Sat, 06 Jul 2019 13:39:06 +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 ) id 1hjku9-0003Hu-RT for pgsql-performance@lists.postgresql.org; Sat, 06 Jul 2019 13:39:06 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hjku6-00008r-TW for pgsql-performance@lists.postgresql.org; Sat, 06 Jul 2019 13:39:05 +0000 Received: by mail-wm1-x341.google.com with SMTP id w9so9444719wmd.1 for ; Sat, 06 Jul 2019 06:39:02 -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:references:mime-version :content-disposition:in-reply-to:user-agent; bh=EP5JZSRK8L03MJvU3RFHm4he6/LHnzqOEYRn6dXyXDU=; b=UL87itCN0/Ljyls+QPHc1UD3uh/v7H/208ZSsTGcyf9b21Au5pELOGXt/8MzroXb6X xE+9VuU1t5DGnmZpVLRptccGY9uEqqcoPzrPuYS/cN4GsXeBq8JaojNZ34rUgeVImVYT eolK4tysluNw1qRGT+/5Lz4/hinXaNnIONlg5lcV3Qh1Ya9GH/I4Ya+lbFojZHPryxaF E9iwbpmmIBWtQYFCpaLp5zC5lNBCZm1ATD3kNUWlXULiI/h1bkmRkMt59NDr7+rvjpKx B07NpB8NPBiUIQDTY0ZFm+FxYhIikjUtsIljxp5B+KX548ff3NHiNOK+wkfQZ8ysM2Yu 73Ng== 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=EP5JZSRK8L03MJvU3RFHm4he6/LHnzqOEYRn6dXyXDU=; b=C0eTW/aQHkSE+wF6GM58kA3/y3QOfNSe4kq2pehl6ZRX7FwHsS4jnHSnA+PbwRLySZ mtgRDbBGZT+00kud19urMI5IkNmTl/TdkkCkQRtgeMrBFoRGnAnN3GH7nOrPd1QwS97B VvSbtRcgn1FNoHwgFsJPNz6GB/lzEgD56XCMEJCeP36QGtJ5krnHMzYpnI/Xud9l6rjl OniugvkgosbxRE2tMedAG8DXzLdordtBgoG6utffBJif+uLkurn3FVJRKw5XcKnGkKF2 GVVpTQyMh8/q20sUUWlp8EG4kdMTX3ZMXKxcRirf3c4biQ1eR+xFcqMENhzsqaAioSTR +ZOQ== X-Gm-Message-State: APjAAAXBUifNCyIBjigT9zaN2VUx6dL3TJpXHufXdyOyKziJY3yW/g5F 704WcGvLkTZ780v/VoB3IYPZqg== X-Google-Smtp-Source: APXvYqy+bID86SId5oaCd4MpK5KHb9PvL+7uk9H5A4PyDuwLg+tiwovO7GT6kPqB1iOUcSQ2AwKu3A== X-Received: by 2002:a1c:a997:: with SMTP id s145mr8017956wme.106.1562420340463; Sat, 06 Jul 2019 06:39:00 -0700 (PDT) Received: from localhost (ip-86-49-253-160.net.upcbroadband.cz. [86.49.253.160]) by smtp.gmail.com with ESMTPSA id t15sm11547766wrx.84.2019.07.06.06.38.59 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 06 Jul 2019 06:38:59 -0700 (PDT) Date: Sat, 6 Jul 2019 15:38:58 +0200 From: Tomas Vondra To: Ancoron Luciferis Cc: pgsql-performance@lists.postgresql.org Subject: Re: Custom opclass for column statistics? Message-ID: <20190706133858.n7lj4wrte6ulcvk3@development> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716-1444-295967 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sat, Jul 06, 2019 at 11:02:27AM +0200, Ancoron Luciferis wrote: >Hi, > >I've been wondering whether it is possible somehow to have the standard >column statistics to respect a certain operator class? > >The reason why I am asking for this is that I have a UUID column with a >unique index at it using a custom operator class which implies a >different sort order than for the default UUID operator class. > >This results into planner mistakes when determining whether to use the >index for row selection or not. Too often it falls back into sequential >scan due to this. > Can you share an example demonstrating the issue? regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services