pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Surafel Temesgen <surafel3000@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: FETCH FIRST clause WITH TIES option
Date: Mon, 29 Oct 2018 15:17:28 +0000
Message-ID: <87r2g87py9.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <40c9e6c5-4fc7-1589-0cc5-8a857405b91a@2ndquadrant.com>
References: <CALAY4q9ky7rD_A4vf=FVQvCGngm3LOes-ky0J6euMrg=_Se+ag@mail.gmail.com>
	<40c9e6c5-4fc7-1589-0cc5-8a857405b91a@2ndquadrant.com>

>>>>> "Tomas" == Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:

 > On 10/26/2018 12:28 PM, Surafel Temesgen wrote:
 >> hello ,
 >> 
 >> The WITH TIES keyword is sql standard that specifies any peers of 
 >> retained rows to retained in the result set too .which means 
 >> according to ordering key the result set can includes additional rows
 >> which have ties on the last position, if there are any and It work
 >> with ORDER BY query.

 Tomas> Thanks for the patch. I've looked at it today, and it seems
 Tomas> mostly OK, with a couple of minor issues. Most of it is code
 Tomas> formatting and comment wording issues, so I'm not going to go
 Tomas> through them here - see the attached 0002 patch (0001 is your
 Tomas> patch, rebased to current master).

I still think that this is the wrong approach. Implementing WITH TIES
and PERCENT together using an implicit window function call kills two
birds with one very small stone (the only executor change needed would
be teaching LIMIT to be able to stop on a boolean condition), with
maximum reuse of existing facilities.

-- 
Andrew (irc:RhodiumToad)




view thread (61+ messages)  latest in thread

Message-ID: <87r2g87py9.fsf@news-spur.riddles.org.uk>
Permalink:  ../87r2g87py9.fsf@news-spur.riddles.org.uk/
Also on:    postgresql.org/message-id/87r2g87py9.fsf@news-spur.riddles.org.uk

 · 

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-hackers@postgresql.org
  Cc: andrew@tao11.riddles.org.uk, tomas.vondra@2ndquadrant.com, surafel3000@gmail.com
  Subject: Re: FETCH FIRST clause WITH TIES option
  In-Reply-To: <87r2g87py9.fsf@news-spur.riddles.org.uk>

* 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