Re: Why is seq search preferred here by planner?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: <mallah(at)trade-india(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Why is seq search preferred here by planner?
Date: 2003-04-23 17:00:20
Message-ID: 200304231000.20578.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Mallah,

> UPDATE email_bank set country=personal_account_details.country where userid
> > 0 and userid=personal_account_details.userid ;

While Postgres is letting you "fudge", you are missing part of that SQL
statement. It should be:

UPDATE email_bank set country=personal_account_details.country
FROM personal_account_details
where userid > 0 and userid=personal_account_details.userid ;

> tradein_clients=# begin work;explain analyze UPDATE email_bank set
> country=personal_account_details.country where userid > 0 and
> userid=personal_account_details.userid ;BEGIN
> Time: 669.57 ms

Hmmm ... 669 ms seems pretty speedy for updating 150,000 rows. What's the
problem?

--
Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message mallah 2003-04-23 17:12:26 Re: Why is seq search preferred here by planner?
Previous Message Greg Stark 2003-04-23 16:32:09 Re: [SQL] Yet Another (Simple) Case of Index not used