Re: Why is seq search preferred here by planner?

From: <mallah(at)trade-india(dot)com>
To: <josh(at)agliodbs(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Why is seq search preferred here by planner?
Date: 2003-04-23 17:12:26
Message-ID: 1248.219.65.233.8.1051117946.squirrel@mail.trade-india.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 ;

yes this is the proper SQL , but that also works and have same results.

>
>> 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?

Hmm i am not running postgresql on a CRAY :-)

that was the time for "begin work;" since
i am explain analysing an update i am putting it in transaction.

the actualt time was nearing 300 secs which is 5 mins

i did an explain of the UPDATE FROM variant of the query it has the same
plan for it.

regds
mallah.

>
> --
> Josh Berkus
> Aglio Database Solutions
> San Francisco

-----------------------------------------
Get your free web based email at trade-india.com.
"India's Leading B2B eMarketplace.!"
http://www.trade-india.com/

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2003-04-23 17:21:38 Re: Why is seq search preferred here by planner?
Previous Message Josh Berkus 2003-04-23 17:00:20 Re: Why is seq search preferred here by planner?