Re: NL Join vs Merge Join - 5 hours vs 2 seconds

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: "Kumar, Virendra" <Virendra(dot)Kumar(at)guycarp(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: NL Join vs Merge Join - 5 hours vs 2 seconds
Date: 2018-12-17 20:48:09
Message-ID: CAKJS1f8gxZbcQXPmB0+VmPVQ6txX1jhq3ZySkwb2yXrEYkomxg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 18 Dec 2018 at 09:21, Kumar, Virendra
<Virendra(dot)Kumar(at)guycarp(dot)com> wrote:
> I tried query with function dependency statistics but it did not help. I don't see we can create such statistics on table join.

There's mention of why this is the case in the docs in [1]:

"14.2.2.1.1. Limitations of Functional Dependencies

Functional dependencies are currently only applied when considering
simple equality conditions that compare columns to constant values.
They are not used to improve estimates for equality conditions
comparing two columns or comparing a column to an expression, nor for
range clauses, LIKE or any other type of condition."

[1] https://www.postgresql.org/docs/10/planner-stats.html

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2018-12-17 21:09:51 Re: Alter table column constraint [RESOLVED]
Previous Message Adrian Klaver 2018-12-17 20:36:39 Re: Alter table column constraint