Correction d'un bug : ne pas avoir les noeuds qui commencent avec '::' comme mot central. (non testé).

This commit is contained in:
Georges Dupéron 2011-03-27 20:34:21 +02:00
parent a48e0cc453
commit 5a3f84bf10

View File

@ -31,6 +31,7 @@ create table game(gid integer primary key autoincrement, eid_central_word, relat
create table game_cloud(gid, num, difficulty, eid_word, totalWeight, probaR1, probaR2, probaR0, probaTrash);
create table played_game(pgid integer primary key autoincrement, gid, login, timestamp);
create table played_game_cloud(pgid, gid, type, num, relation, weight, score);
create table colon_nodes(eid);
create table random_cloud_node(eid,nbneighbors);
create table random_center_node(eid);
@ -61,15 +62,21 @@ create index i_relation_type on relation(type);
create index i_relation_start_type on relation(start,type);
create index i_relation_end_type on relation(end,type);
create index i_played_game_all on played_game(pgid, gid, login, timestamp);
create index i_colon_nodes_eid on colon_nodes(eid);
insert into colon_nodes(eid) select eid from node where name glob '::*';
insert into random_cloud_node(eid,nbneighbors) select eid,sum(nb) from (
select (select type from node where node.eid = relation.start) as type,
start as eid,
count(start) as nb from relation where type not in (4, 12, 36, 18, 29, 45, 46, 47, 48, 1000, 1001)
count(start) as nb from relation
where type not in (4, 12, 36, 18, 29, 45, 46, 47, 48, 1000, 1001) and start not in colon_nodes
group by start
union
select (select type from node where node.eid = relation.start) as type,
end as eid,
count(end) as nb from relation where type not in (4, 12, 36, 18, 29, 45, 46, 47, 48, 1000, 1001)
count(end) as nb from relation
where type not in (4, 12, 36, 18, 29, 45, 46, 47, 48, 1000, 1001) and start not in colon_nodes
group by end
) where type = 1 group by eid;
create index i_random_cloud_node_nbneighbors on random_cloud_node(nbneighbors);