Skip to content

Instantly share code, notes, and snippets.

@albanpeignier
Created May 21, 2010 16:09
Show Gist options
  • Select an option

  • Save albanpeignier/409030 to your computer and use it in GitHub Desktop.

Select an option

Save albanpeignier/409030 to your computer and use it in GitHub Desktop.
stif_chouette=# EXPLAIN update chouette.vehiclejourneyatstop_tmp set vehiclejourneyid = v.id_new from chouette.vehiclejourney_tmp v WHERE v.id = vehiclejourneyid;
QUERY PLAN
---------------------------------------------------------------------------------------------
Hash Join (cost=59166.51..3706640.95 rows=10308224 width=1096)
Hash Cond: (vehiclejourneyatstop_tmp.vehiclejourneyid = v.id)
-> Seq Scan on vehiclejourneyatstop_tmp (cost=0.00..632584.24 rows=10308224 width=1096)
-> Hash (cost=48648.45..48648.45 rows=605045 width=16)
-> Seq Scan on vehiclejourney_tmp v (cost=0.00..48648.45 rows=605045 width=16)
stif_chouette=# EXPLAIN select v.routeid from chouette.vehiclejourney_tmp v WHERE v.id = 5000;
QUERY PLAN
----------------------------------------------------------------------------------------------------
Index Scan using vehiclejourney_tmp_pkey on vehiclejourney_tmp v (cost=0.00..8.33 rows=1 width=8)
Index Cond: (id = 5000)
stif_chouette=# EXPLAIN update chouette.vehiclejourneyatstop_tmp set vehiclejourneyid = v.id_new from chouette.vehiclejourney_tmp v WHERE v.id = vehiclejourneyid;
QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------------------------
Merge Join (cost=22.61..61359926.58 rows=15896329 width=1096)
Merge Cond: (v.id = vehiclejourneyatstop_tmp.vehiclejourneyid)
-> Index Scan using vehiclejourney_tmp_pkey on vehiclejourney_tmp v (cost=0.00..103705.20 rows=605045 width=16)
-> Index Scan using vehiclejourneyatstop_tmp_on_vehiclejourneyid on vehiclejourneyatstop_tmp (cost=0.00..61366246.03 rows=15896329 width=1096)
(4 rows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment