Re: HELP speed up my Postgres - Mailing list pgsql-performance

From Christopher Kings-Lynne
Subject Re: HELP speed up my Postgres
Date
Msg-id 41A58473.5020106@familyhealth.com.au
Whole thread Raw
In response to HELP speed up my Postgres  (JM <jerome@gmanmi.tv>)
Responses Re: [GENERAL] HELP speed up my Postgres
List 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

pgsql-performance by date:

Previous
From: Klint Gore
Date:
Subject: Re: HELP speed up my Postgres
Next
From: Dave Cramer
Date:
Subject: Re: Postgres vs. MySQL