pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: twoflower <standa.kurik@gmail.com>
To: pgsql-performance@postgresql.org
Subject: Re: Huge difference between ASC and DESC ordering
Date: Mon, 6 Mar 2017 09:46:32 -0700 (MST)
Message-ID: <1488818792254-5947737.post@n3.nabble.com> (raw)
In-Reply-To: <CAMkU=1yThfvCjHCtvFxGzf3GUeqqTQA+ftzshZ_NwcnkFjjN7w@mail.gmail.com>
References: <1488810146219-5947712.post@n3.nabble.com>
	<CAMkU=1yThfvCjHCtvFxGzf3GUeqqTQA+ftzshZ_NwcnkFjjN7w@mail.gmail.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

Thank you Jeff.

There are 7 million rows satisfying fk_id_client = 20045. There is an index
on fk_id_client, now I added a composite (fk_id_client, id) index but that
did not help.

I see the point of what you are saying, but still don't understand how these
two situations (*asc* vs. *desc*) are not symmetrical. I mean, there /is/ an
ascending index on *JOB_MEMORY.id*, so why does it matter which end I am
picking the data from?

The thing is, even when I force Postgres to use the ascending index on *id*,
it's still orders of magnitude slower than the *desc* version (even when
that one goes through the index backwards).



--
View this message in context: http://www.postgresql-archive.org/Huge-difference-between-ASC-and-DESC-ordering-tp5947712p5947737.ht...
Sent from the PostgreSQL - performance mailing list archive at Nabble.com.

view thread (5+ messages)  latest in thread

Message-ID: <1488818792254-5947737.post@n3.nabble.com>
Permalink:  ../1488818792254-5947737.post@n3.nabble.com/
Also on:    postgresql.org/message-id/1488818792254-5947737.post@n3.nabble.com

 · 

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: standa.kurik@gmail.com
  Subject: Re: Huge difference between ASC and DESC ordering
  In-Reply-To: <1488818792254-5947737.post@n3.nabble.com>

* 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