Project

General

Profile

Actions

Task #449

open

optimize JOINs on existing rows

Added by Aaron Marcuse-Kubitza over 12 years ago.

Status:
New
Priority:
Normal
Start date:
07/30/2012
Due date:
% Done:

0%

Estimated time:
Activity type:

Description

vegbiendev:/home/bien/svn/inputs/SpeciesLink/import/specimens.2012-07-17-23-12-36.log.sql:
[2] DB query: non-cacheable:
Took 0:32:03.008784 sec

/*SpeciesLink.specimens*/
CREATE TEMP TABLE "namedplace[rank='country']" AS
SELECT
"in#23"."row_num" 
, "namedplace"."namedplace_id" 
FROM "in#23" 
JOIN "namedplace" ON
COALESCE("namedplace"."parent_id", CAST(2147483647 AS integer)) = COALESCE("in#23"."namedplace[rank='continent'].namedplace_id", CAST(2147483647 AS integer))
AND "namedplace"."placename" = "in#23"."_alt(1=conceptual_darwin_2003_1_0_Country, 0=dwc_dwcore).result" 
AND "namedplace"."rank" = 'country'
/* EXPLAIN:
Merge Join  (cost=6733.44..43721.13 rows=14 width=8)
  Merge Cond: (COALESCE("in#23"."namedplace[rank='continent'].namedplace_id", 2147483647) = (COALESCE(namedplace.parent_id, 2147483647)))
  Join Filter: ("in#23"."_alt(1=conceptual_darwin_2003_1_0_Country, 0=dwc_dwcore).result" = namedplace.placename)
  ->  Index Scan using "in#23_coalesce_coalesce1_idx" on "in#23"  (cost=0.00..25888.33 rows=500000 width=15)
  ->  Sort  (cost=6733.44..6804.03 rows=28239 width=20)
        Sort Key: (COALESCE(namedplace.parent_id, 2147483647))
        ->  Seq Scan on namedplace  (cost=0.00..4645.81 rows=28239 width=20)
              Filter: (rank = 'country'::placerank)
*/

No data to display

Actions

Also available in: Atom PDF