Re: [GENERAL] Update big table

2013-07-17 Thread Haiming Zhang
[mailto:bladeofligh...@gmail.com] Sent: Monday, 15 July 2013 5:26 AM To: pgsql-general@postgresql.org; Haiming Zhang Subject: Re: [GENERAL] Update big table I don't believe you can use JOIN explicitly in this situation because it's an UPDATE, but I believe you can accomplish the same effect wit

Re: [GENERAL] Update big table

2013-07-15 Thread bricklen
On Mon, Jul 15, 2013 at 6:08 AM, Haiming Zhang wrote: > I run my query using JOIN for two hours, and did not get it done. Here is > my query: > > update table1 set col1 = true from table2 where table1.event_id = > table2.event_id > Did you already post the query plan from "EXPLAIN update table1

Re: [GENERAL] Update big table

2013-07-15 Thread Haiming Zhang
-Original Message- From: Vincenzo Romano [mailto:vincenzo.rom...@notorand.it] Sent: Sunday, 14 July 2013 9:03 PM To: Haiming Zhang Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Update big table 2013/7/14 Haiming Zhang : > Hi All, > > > > I am using postgres 9.1, I

Re: [GENERAL] Update big table

2013-07-14 Thread BladeOfLight16
I don't believe you can use JOIN explicitly in this situation because it's an UPDATE, but I believe you can accomplish the same effect with FROM and WHERE. UPDATE table SET column1 = TRUE FROM table2 WHERE table1.event_id = table2.event_id; I would make sure there's an index on table2.event_id if

Re: [GENERAL] Update big table

2013-07-14 Thread Vincenzo Romano
2013/7/14 Haiming Zhang : > Hi All, > > > > I am using postgres 9.1, I have a question about updating big table. Here is > the basic information of this table. > > 1. This table has one primary key and other 11 columns. > > 2. It also has a trigger that before updat

[GENERAL] Update big table

2013-07-14 Thread Haiming Zhang
Hi All, I am using postgres 9.1, I have a question about updating big table. Here is the basic information of this table. 1. This table has one primary key and other 11 columns. 2. It also has a trigger that before update records, another table got updated first.