pdbench/graph_data/triangle-query.sql

13 lines
328 B
SQL

/**
** Computes the u-relation representing the possible triangles in a random graph.
** Assumes init-nodes and init-randgraph.sql have been executed.
*/
drop table UD;
create table UD as
select 1
from edge0 e1, edge0 e2, edge0 e3
where e1.v = e2.u and e2.v = e3.v and e1.u = e3.u
and e1.u != e2.u and e2.u != e3.v;