0

I am processing a table with 12 million rows in a postgresql database with the following query:

UPDATE EZDATA A 
SET start_x = B.longitude, start_y = B.latitude
FROM public.stops B
WHERE A._1_boarding_stop_stn = B.stop_code;

Running the same query for 1 million rows takes 4 minutes. However running it for 12 million rows still run since 3 days.

Can anyone help me on optimizing this query, since it takes a long processing time?

Panup Pong
  • 1,871
  • 2
  • 22
  • 44
Omar
  • 25
  • 8
  • Due SO is a programming related site, may I suggest you to move this post to http://dba.stackexchange.com? – McNets Mar 13 '17 at 09:04
  • 2
    Please **[EDIT]** your question and add the execution plan generated using **`explain (analyze, verbose)`**. [**Formatted text**](http://stackoverflow.com/help/formatting) please, [no screen shots](http://meta.stackoverflow.com/questions/285551/why-may-i-not-upload-images-of-code-on-so-when-asking-a-question/285557#285557) –  Mar 13 '17 at 09:08
  • the query explain (analyze, verbose) run for 10 hours and did not finish till now. any suggestions? – Omar Mar 14 '17 at 04:16
  • Then at least show us the output of `explain (verbose)` –  Mar 27 '17 at 05:59

0 Answers0