Changes between Version 45 and Version 46 of Noeud - parcours RHT


Ignore:
Timestamp:
Jan 6, 2012 11:55:26 AM (13 years ago)
Author:
celine
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Noeud - parcours RHT

    v45 v46  
    286286-- script de calcul des distances sources 
    287287set search_path to rht,public; 
    288 select cast(ltree2text(subltree(chemin,0,1)) as integer) from rht_topology limit 10 
     288select cast(ltree2text(subltree(chemin,0,1)) as integer) from rhtvs2 limit 10 
    289289/* 
    290290AJOUT D'UN INDEX 
     
    293293    GiST index over ltree: <, <=, =, >=, >, @>, <@, @, ~, ?  
    294294*/ 
    295 CREATE INDEX chemin_btee_index ON rht.rht_topology USING btree(chemin); --27688 ms 
    296 VACUUM ANALYSE rht.rht_topology; 
     295CREATE INDEX chemin_btee_indexvs2 ON rht.rhtvs2 USING btree(chemin); --27688 ms 
     296VACUUM ANALYSE rht.rhtvs2; 
    297297CREATE INDEX chemin_gist_index ON rht.rht_topology USING GIST (chemin); -- fait planter mon serveur.... 
    298 SELECT * from rht.rht_topology where chemin <@ '212340'; -- tronçon source de la Vilaine -- 2360 
    299 SELECT chemin from rht.rht_topology where chemin <@ '212340' limit 1 
     298SELECT * from rht.rhtvs2 where chemin <@ '212340'; -- tronçon source de la Vilaine -- 35641 
     299SELECT chemin from rht.rhtvs2 where chemin <@ '212340' limit 1 
    300300-- La distance source est la distance mer maximale de tous les chemins possibles en ne prenant que le dernier tronçon du chemin. 
    301 Select max(dmer) from rht.rht_topology where id_drain in ( 
     301Select max(dmer) from rht.rhtvs2 where id_drain in ( 
    302302Select cast(ltree2text(subpath(chemin, -1, 1))as integer) as chenin_id_drain from rht.rht_topology where chemin ~ '*.212340.*'); 
    303303--  travail sur les noeuds source et le recalcul des distances mer et source (voir fichier doc joint) 
    304304-- en pratique les distances sont calculées a partir du milieu de chaque tronçon, elles prennent par contre toute la distance des tronçons autre que le tronçon considéré. 
    305305 
    306 alter table rht.rht_topology add column noeudsource boolean default FALSE; 
     306--si noeudsource non intégrés les intégrer  (ici déjà intégrés) 
     307alter table rht.rhtvs2 add column noeudsource boolean default FALSE; 
    307308-- identification des noeuds source 
    308 update rht.rht_topology set noeudsource=TRUE where id_drain in ( 
    309 select id_drain from rht.rht_topology except ( 
    310 select rt2.id_drain from rht.rht_topology rt1 join rht.rht_topology rt2 on rt1.nextdownid=rt2.id_drain) 
    311 );-- 57533 
    312 update rht.rht_topology set dmer=dmer+length/2;-- 114600 
     309update rht.rhtvs2 set noeudsource=TRUE where id_drain in ( 
     310select id_drain from rht.rhtvs2 except ( 
     311select rt2.id_drain from rht.rhtvs2 rt1 join rht.rhtvs2 rt2 on rt1.nextdownid=rt2.id_drain) 
     312); 
     313 
    313314alter table rht.rht_topology add column dsource numeric; 
    314 update rht.rht_topology set dsource=length/2 where noeudsource;-- 57533 
    315315-- voir schéma pour explications 
    316316