Re: how to improve perf of 131MM row table?

From: Matheus de Oliveira <matioli(dot)matheus(at)gmail(dot)com>
To: AJ Weber <aweber(at)comcast(dot)net>
Cc: Shaun Thomas <sthomas(at)optionshouse(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: how to improve perf of 131MM row table?
Date: 2014-06-26 14:14:27
Message-ID: CAJghg4KZN0DxC34MRh1j_w+gAB6j=ho0Puwd5jcqJb-tOcyFzw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, Jun 26, 2014 at 11:07 AM, AJ Weber <aweber(at)comcast(dot)net> wrote:

> I will try this, but can you clarify the syntax? I only know the VALUES
> clause from insert statements, and it would be one set of parens like
> VALUES('175769', '175771', ... )
>
>
That is for multiple columns, mine is for multiple rows (and it also work
on INSERT to insert many rows at once).

The result would be:

WHERE node_id in
VALUES(('175769'), ('175771'), ('175781'), ('175825'),
('175881'), ('175893'), ('175919'), ('175932'), ('175963'), ('175999'),
('176022'), ('176079'), ('176099'), ('176115'), ('176118'), ('176171'),
('176181'), ('176217'), ('176220'), ('176243'), ('176283'), ('176312'),
('176326'), ('176335'), ('176377'), ('176441'), ('176444'), ('176475'),
('176530'), ('176570'), ('176623'), ('176674'), ('176701'), ('176730'),
('176748'), ('176763'), ('176771'), ('176808'), ('176836'), ('176851'),
('176864'), ('176881'), ('176929'), ('176945'), ('176947'), ('176960'),
('177006'), ('177039'), ('177079'), ('177131'), ('177144'))

You seem to indicate a VALUES clause that has strange parenthesis
> corresponding to it.
>

No, nothing strange, you are just not aware of the syntax. See [1], and a
more clear example (for INSERT) at [2], look for "To insert multiple rows
using the multirow VALUES syntax:".

[1] http://www.postgresql.org/docs/current/static/sql-values.html
[2] http://www.postgresql.org/docs/current/static/sql-insert.html#AEN78471

--
Matheus de Oliveira
Analista de Banco de Dados
Dextra Sistemas - MPS.Br nível F!
www.dextra.com.br/postgres

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message AJ Weber 2014-06-26 14:22:59 Re: how to improve perf of 131MM row table?
Previous Message AJ Weber 2014-06-26 14:07:45 Re: how to improve perf of 131MM row table?