Re: [PERFORM] HELP speed up my Postgres

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: jerome(at)gmanmi(dot)tv
Cc: pgsql-performance(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: [PERFORM] HELP speed up my Postgres
Date: 2004-11-25 07:06:27
Message-ID: 41A58473.5020106@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

> update SUBSCRIPTIONTABLE set ACTIVEFLAG='Y' where mobile_num in (select
> mobile_num from LOADED_MOBILE_NUMBERS)

Change to:

update SUBSCRIPTIONTABLE set ACTIVEFLAG='Y' where exists (select 1 from
LOADED_MOBILE_NUMBERS lmn where
lmn.mobile_num=SUBSCRIPTIONTABLE.mobile_num);

That should run a lot faster.

Make sure you have indexes on both mobile_num columns.

Chris

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Klint Gore 2004-11-25 07:08:30 Re: [PERFORM] HELP speed up my Postgres
Previous Message Tom Lane 2004-11-25 06:55:25 Re: [PERFORM] HELP speed up my Postgres

Browse pgsql-performance by date

  From Date Subject
Next Message Klint Gore 2004-11-25 07:08:30 Re: [PERFORM] HELP speed up my Postgres
Previous Message Tom Lane 2004-11-25 06:55:25 Re: [PERFORM] HELP speed up my Postgres