pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: tuanhoanganh <hatuan05@gmail.com>
Cc: PostgreSQL <pgsql-general@postgresql.org>
Cc: pgsql-performance <pgsql-performance@postgresql.org>
Subject: Re: [GENERAL] Why Postgres use a little memory on Windows.
Date: Sat, 20 Feb 2016 13:37:11 -0500
Message-ID: <23887.1455993431@sss.pgh.pa.us> (raw)
In-Reply-To: <56C8ACBE.60004@aklaver.com>
References: <CAJg-yaO8OtzqTxsusesqntPhxG=LDc9skQe3SaVWw30NuWTs5Q@mail.gmail.com>
	<56C8ACBE.60004@aklaver.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

Adrian Klaver <adrian.klaver@aklaver.com> writes:
> Took liberty of reformatting the above here:
> ...
> FROM
>      sym_data d INNER JOIN sym_data_gap g ON g.status = 'GP'
>      AND d.data_id BETWEEN g.start_id
>      AND g.end_id
> WHERE
>      d.channel_id = 'sale_transaction'
> ORDER BY
>      d.data_id ASC;

> The thing that stands out to me is that I do not see that sym_data and 
> sym_data_gp are actually joined on anything.

The "d.data_id BETWEEN g.start_id AND g.end_id" part is a join condition
... but not one that can be handled by either hash or merge join, because
those require simple equality join conditions.  So the nestloop plan shown
here is really about as good as you're going to get without redesigning
the query and/or the data representation.

It looks like the bitmap heap scan generally returns exactly one row for
each outer row, which makes me wonder if the BETWEEN couldn't be replaced
with some sort of equality.  But that might take some rethinking of the
data.

			regards, tom lane


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (8+ messages)  latest in thread

Message-ID: <23887.1455993431@sss.pgh.pa.us>
Permalink:  ../23887.1455993431@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23887.1455993431@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, adrian.klaver@aklaver.com, hatuan05@gmail.com, pgsql-general@postgresql.org
  Subject: Re: [GENERAL] Why Postgres use a little memory on Windows.
  In-Reply-To: <23887.1455993431@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox