pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Luís Roberto Weck <luisroberto@siscobra.com.br>
To: Michael Lewis <mlewis@entrata.com>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: Last event per user
Date: Mon, 12 Aug 2019 20:03:54 -0300
Message-ID: <1ab9f8c65040b2e724e559ce9bc0b8cd@siscobra.com.br> (raw)
In-Reply-To: <CAHOFxGqT2CQHmP8J_qE3nwLL-3xMSFjjr1cpmTY4Wv4ioEqRVg@mail.gmail.com>
References: <f2188f91-12ea-cd2b-40b9-eef4a1367252@siscobra.com.br>
	<CAHOFxGqhh5T2Uidw6ha404kiX87ipgs4MCGKOoDOqsp=j4Z89g@mail.gmail.com>
	<3fba6c11d158490b07afebc5a21c7aa9@siscobra.com.br>
	<CAHOFxGpUwcjhs9trJwAkNNhY8doyi2shzCr=2ymLk+-3RzJhrA@mail.gmail.com>
	<e3e3f5e059d212c962d8cdb128837549@siscobra.com.br>
	<CAHOFxGqT2CQHmP8J_qE3nwLL-3xMSFjjr1cpmTY4Wv4ioEqRVg@mail.gmail.com>

> If you modify last_user_event_2 to select user and event info in the view, and just put there where clause directly on the view which is not joined to anything, instead of on the "extra copy" of the users table like you were showing previously, I would expect that the performance should be excellent.

But I need user_id and user_group to be outside of the view definition.
user_id and user_group are dynamic values, as in, I need to call this
query multiple times for different user_ids and user_groups .

view thread (7+ messages)  latest in thread

Message-ID: <1ab9f8c65040b2e724e559ce9bc0b8cd@siscobra.com.br>
Permalink:  ../1ab9f8c65040b2e724e559ce9bc0b8cd@siscobra.com.br/
Also on:    postgresql.org/message-id/1ab9f8c65040b2e724e559ce9bc0b8cd@siscobra.com.br

 · 

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: luisroberto@siscobra.com.br, mlewis@entrata.com, pgsql-performance@lists.postgresql.org
  Subject: Re: Last event per user
  In-Reply-To: <1ab9f8c65040b2e724e559ce9bc0b8cd@siscobra.com.br>

* 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