Changes between Version 45 and Version 46 of Noeud - parcours RHT
- Timestamp:
- Jan 6, 2012 11:55:26 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Noeud - parcours RHT
v45 v46 286 286 -- script de calcul des distances sources 287 287 set search_path to rht,public; 288 select cast(ltree2text(subltree(chemin,0,1)) as integer) from rht _topologylimit 10288 select cast(ltree2text(subltree(chemin,0,1)) as integer) from rhtvs2 limit 10 289 289 /* 290 290 AJOUT D'UN INDEX … … 293 293 GiST index over ltree: <, <=, =, >=, >, @>, <@, @, ~, ? 294 294 */ 295 CREATE INDEX chemin_btee_index ON rht.rht_topologyUSING btree(chemin); --27688 ms296 VACUUM ANALYSE rht.rht _topology;295 CREATE INDEX chemin_btee_indexvs2 ON rht.rhtvs2 USING btree(chemin); --27688 ms 296 VACUUM ANALYSE rht.rhtvs2; 297 297 CREATE 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 -- 2360299 SELECT chemin from rht.rht _topologywhere chemin <@ '212340' limit 1298 SELECT * from rht.rhtvs2 where chemin <@ '212340'; -- tronçon source de la Vilaine -- 35641 299 SELECT chemin from rht.rhtvs2 where chemin <@ '212340' limit 1 300 300 -- 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 _topologywhere id_drain in (301 Select max(dmer) from rht.rhtvs2 where id_drain in ( 302 302 Select cast(ltree2text(subpath(chemin, -1, 1))as integer) as chenin_id_drain from rht.rht_topology where chemin ~ '*.212340.*'); 303 303 -- travail sur les noeuds source et le recalcul des distances mer et source (voir fichier doc joint) 304 304 -- 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é. 305 305 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) 307 alter table rht.rhtvs2 add column noeudsource boolean default FALSE; 307 308 -- identification des noeuds source 308 update rht.rht _topologyset noeudsource=TRUE where id_drain in (309 select id_drain from rht.rht _topologyexcept (310 select rt2.id_drain from rht.rht _topology rt1 join rht.rht_topologyrt2 on rt1.nextdownid=rt2.id_drain)311 ); -- 57533312 update rht.rht_topology set dmer=dmer+length/2;-- 114600 309 update rht.rhtvs2 set noeudsource=TRUE where id_drain in ( 310 select id_drain from rht.rhtvs2 except ( 311 select rt2.id_drain from rht.rhtvs2 rt1 join rht.rhtvs2 rt2 on rt1.nextdownid=rt2.id_drain) 312 ); 313 313 314 alter table rht.rht_topology add column dsource numeric; 314 update rht.rht_topology set dsource=length/2 where noeudsource;-- 57533315 315 -- voir schéma pour explications 316 316