Re: [PERFORM] how to change the provoke table in hash join

2014-09-11 Thread Huang, Suya
From: Jeff Janes [mailto:jeff.ja...@gmail.com] Sent: Friday, September 12, 2014 4:09 AM To: Matheus de Oliveira Cc: Huang, Suya; pgsql-performance@postgresql.org Subject: Re: [PERFORM] how to change the provoke table in hash join On Thu, Sep 11, 2014 at 7:09 AM, Matheus de Oliveira

Re: [PERFORM] how to change the provoke table in hash join

2014-09-11 Thread Jeff Janes
On Thu, Sep 11, 2014 at 7:09 AM, Matheus de Oliveira < matioli.math...@gmail.com> wrote: > > On Wed, Sep 10, 2014 at 10:05 PM, Huang, Suya > wrote: > >> --plan 1, 10 seconds were spent on sequential scan on term_weekly table. >> >> >> >> dev=# explain analyze select distinct cs_id from lookup_we

Re: [PERFORM] how to change the provoke table in hash join

2014-09-11 Thread Matheus de Oliveira
On Wed, Sep 10, 2014 at 10:05 PM, Huang, Suya wrote: > --plan 1, 10 seconds were spent on sequential scan on term_weekly table. > > > > dev=# explain analyze select distinct cs_id from lookup_weekly n inner > join term_weekly s on s.b_id=n.b_id and s.date=n.date where term in > ('cat'::text); >

[PERFORM] how to change the provoke table in hash join

2014-09-10 Thread Huang, Suya
Hi, Below are two query plan for same SQL with and without an index. I noticed the Hash join order has changed since index has been created and this is not what I want. As it's hashing the big table and to provoke records in a small table. in Oracle, it's simple to add hint to point the table