-
Notifications
You must be signed in to change notification settings - Fork 0
/
benchmarking_1000_nodes_1000_edges.sql
349 lines (301 loc) · 24.6 KB
/
benchmarking_1000_nodes_1000_edges.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
drop table if exists graph;
CREATE TABLE graph (
x text,
r text,
y text
);
INSERT
INTO
graph(x, r, y)
VALUES
('232', 'b', '183'), ('619', 'c', '27'), ('626', 'a', '130'), ('484', 'a', '912'), ('470', 'a', '309'), ('107', 'a', '378'), ('958', 'a', '354'), ('669', 'c', '541'), ('378', 'b', '731'), ('521', 'b', '258'), ('618', 'a', '305'), ('530', 'c', '508'), ('822', 'c', '832'), ('744', 'a', '187'), ('544', 'b', '358'), ('293', 'a', '202'), ('702', 'b', '119'), ('283', 'b', '364'), ('372', 'c', '207'), ('837', 'c', '929'), ('142', 'b', '857'), ('556', 'a', '188'), ('773', 'a', '273'), ('827', 'b', '917'), ('521', 'a', '27'), ('589', 'a', '937'), ('326', 'a', '529'), ('466', 'a', '514'), ('476', 'a', '344'), ('40', 'b', '794'), ('612', 'c', '240'), ('166', 'a', '835'), ('22', 'c', '356'), ('48', 'b', '190'), ('949', 'c', '232'), ('688', 'c', '508'), ('124', 'c', '540'), ('497', 'c', '1'), ('300', 'a', '404'), ('219', 'c', '314'), ('587', 'a', '399'), ('472', 'a', '470'), ('385', 'a', '146'), ('57', 'b', '138'), ('517', 'a', '614'), ('193', 'b', '665'), ('159', 'a', '548'), ('809', 'a', '444'), ('106', 'c', '758'), ('970', 'c', '383'), ('428', 'c', '666'), ('370', 'a', '173'), ('719', 'b', '459'), ('711', 'c', '179'), ('451', 'c', '526'), ('970', 'b', '435'), ('958', 'c', '760'), ('9', 'c', '367'), ('948', 'b', '590'), ('732', 'b', '703'), ('352', 'c', '426'), ('415', 'a', '262'), ('508', 'a', '732'), ('680', 'b', '462'), ('554', 'a', '249'), ('476', 'b', '950'), ('779', 'b', '211'), ('34', 'c', '755'), ('770', 'a', '863'), ('272', 'a', '171'), ('816', 'a', '55'), ('815', 'a', '977'), ('214', 'c', '480'), ('95', 'c', '217'), ('183', 'b', '942'), ('906', 'c', '47'), ('770', 'b', '76'), ('921', 'b', '128'), ('307', 'b', '568'), ('329', 'a', '943'), ('111', 'c', '773'), ('693', 'a', '167'), ('967', 'c', '281'), ('906', 'a', '538'), ('520', 'a', '832'), ('553', 'b', '715'), ('744', 'a', '620'), ('800', 'c', '384'), ('185', 'a', '607'), ('353', 'a', '994'), ('14', 'b', '482'), ('399', 'c', '481'), ('955', 'a', '600'), ('35', 'c', '463'), ('457', 'b', '386'), ('837', 'b', '961'), ('33', 'a', '813'), ('273', 'a', '402'), ('554', 'b', '811'), ('210', 'c', '597'), ('139', 'c', '423'), ('321', 'a', '454'), ('700', 'c', '321'), ('442', 'a', '788'), ('147', 'c', '68'), ('154', 'a', '212'), ('94', 'c', '770'), ('279', 'a', '197'), ('469', 'c', '896'), ('532', 'c', '531'), ('966', 'b', '145'), ('785', 'b', '78'), ('952', 'c', '929'), ('311', 'a', '468'), ('710', 'a', '20'), ('743', 'c', '582'), ('727', 'b', '429'), ('817', 'a', '121'), ('114', 'c', '88'), ('672', 'c', '835'), ('986', 'a', '828'), ('271', 'b', '317'), ('707', 'a', '214'), ('854', 'c', '637'), ('496', 'c', '472'), ('807', 'b', '433'), ('289', 'c', '250'), ('790', 'a', '534'), ('448', 'c', '449'), ('620', 'c', '955'), ('490', 'a', '165'), ('571', 'a', '716'), ('19', 'a', '28'), ('139', 'b', '602'), ('528', 'b', '993'), ('694', 'c', '808'), ('543', 'a', '178'), ('301', 'c', '916'), ('765', 'b', '752'), ('146', 'a', '230'), ('914', 'b', '145'), ('243', 'a', '216'), ('785', 'a', '174'), ('778', 'a', '974'), ('719', 'c', '631'), ('871', 'c', '549'), ('900', 'c', '360'), ('587', 'a', '100'), ('622', 'a', '18'), ('279', 'b', '241'), ('234', 'b', '175'), ('94', 'a', '998'), ('178', 'b', '139'), ('807', 'a', '635'), ('377', 'a', '631'), ('980', 'a', '300'), ('915', 'b', '153'), ('833', 'c', '544'), ('673', 'a', '502'), ('926', 'a', '434'), ('916', 'a', '253'), ('634', 'c', '674'), ('936', 'b', '697'), ('939', 'a', '223'), ('437', 'c', '968'), ('424', 'c', '625'), ('199', 'b', '289'), ('308', 'b', '894'), ('110', 'b', '262'), ('968', 'a', '451'), ('375', 'b', '750'), ('953', 'c', '392'), ('159', 'b', '410'), ('918', 'c', '366'), ('424', 'b', '98'), ('268', 'c', '159'), ('577', 'c', '508'), ('59', 'b', '648'), ('568', 'c', '309'), ('855', 'b', '750'), ('850', 'a', '98'), ('350', 'a', '714'), ('226', 'c', '964'), ('610', 'b', '120'), ('526', 'c', '226'), ('408', 'b', '185'), ('771', 'c', '495'), ('973', 'b', '915'), ('551', 'b', '33'), ('958', 'a', '59'), ('478', 'b', '115'), ('281', 'a', '497'), ('572', 'c', '168'), ('377', 'a', '824'), ('333', 'c', '672'), ('707', 'b', '209'), ('171', 'a', '936'), ('219', 'a', '674'), ('635', 'b', '104'), ('321', 'b', '447'), ('684', 'b', '737'), ('904', 'b', '989'), ('221', 'b', '983'), ('347', 'a', '595'), ('334', 'c', '428'), ('651', 'a', '515'), ('351', 'c', '684'), ('308', 'a', '94'), ('482', 'c', '492'), ('387', 'c', '999'), ('167', 'c', '215'), ('199', 'a', '253'), ('891', 'c', '388'), ('158', 'a', '989'), ('298', 'c', '108'), ('554', 'b', '585'), ('31', 'c', '452'), ('798', 'b', '233'), ('242', 'a', '937'), ('352', 'a', '641'), ('101', 'a', '787'), ('947', 'b', '708'), ('69', 'c', '921'), ('779', 'c', '535'), ('621', 'c', '620'), ('576', 'b', '245'), ('605', 'b', '830'), ('665', 'c', '924'), ('15', 'a', '199'), ('21', 'b', '500'), ('689', 'c', '520'), ('444', 'a', '274'), ('220', 'a', '245'), ('54', 'a', '246'), ('986', 'c', '542'), ('413', 'a', '601'), ('131', 'b', '512'), ('230', 'c', '186'), ('421', 'b', '590'), ('28', 'b', '11'), ('177', 'c', '336'), ('242', 'a', '32'), ('774', 'a', '199'), ('95', 'b', '1'), ('884', 'c', '989'), ('370', 'a', '700'), ('874', 'b', '594'), ('354', 'a', '586'), ('813', 'c', '781'), ('618', 'a', '155'), ('419', 'b', '54'), ('899', 'c', '328'), ('325', 'b', '702'), ('471', 'a', '479'), ('767', 'a', '589'), ('748', 'c', '877'), ('427', 'b', '574'), ('894', 'a', '700'), ('736', 'a', '978'), ('647', 'c', '866'), ('580', 'b', '863'), ('510', 'a', '308'), ('470', 'b', '408'), ('338', 'c', '495'), ('383', 'a', '301'), ('673', 'a', '547'), ('144', 'b', '450'), ('26', 'c', '531'), ('247', 'a', '746'), ('109', 'c', '789'), ('424', 'a', '983'), ('717', 'c', '148'), ('466', 'a', '444'), ('271', 'c', '391'), ('923', 'a', '656'), ('585', 'b', '695'), ('49', 'a', '392'), ('238', 'a', '338'), ('242', 'c', '334'), ('708', 'c', '512'), ('468', 'c', '523'), ('176', 'c', '571'), ('70', 'c', '685'), ('841', 'c', '125'), ('383', 'c', '545'), ('117', 'c', '940'), ('447', 'b', '892'), ('103', 'b', '780'), ('673', 'c', '274'), ('521', 'c', '280'), ('947', 'b', '358'), ('123', 'a', '447'), ('712', 'a', '895'), ('89', 'c', '641'), ('505', 'b', '266'), ('178', 'a', '239'), ('753', 'b', '147'), ('678', 'b', '27'), ('381', 'b', '812'), ('1', 'b', '696'), ('556', 'c', '169'), ('384', 'b', '540'), ('193', 'b', '515'), ('121', 'a', '598'), ('737', 'a', '560'), ('929', 'b', '340'), ('157', 'c', '79'), ('878', 'b', '952'), ('815', 'c', '463'), ('635', 'b', '889'), ('840', 'a', '384'), ('481', 'a', '612'), ('130', 'a', '958'), ('286', 'a', '179'), ('495', 'b', '628'), ('828', 'a', '587'), ('650', 'a', '305'), ('823', 'c', '299'), ('370', 'c', '252'), ('128', 'b', '911'), ('621', 'a', '181'), ('85', 'b', '514'), ('423', 'c', '480'), ('294', 'a', '17'), ('258', 'b', '420'), ('773', 'c', '795'), ('203', 'c', '584'), ('622', 'c', '600'), ('453', 'c', '648'), ('462', 'b', '948'), ('753', 'c', '360'), ('844', 'b', '431'), ('307', 'b', '128'), ('193', 'a', '463'), ('976', 'a', '357'), ('914', 'a', '283'), ('687', 'c', '206'), ('838', 'a', '233'), ('41', 'b', '47'), ('839', 'c', '986'), ('743', 'a', '896'), ('845', 'c', '85'), ('734', 'b', '717'), ('182', 'b', '914'), ('633', 'b', '332'), ('786', 'c', '416'), ('801', 'a', '224'), ('422', 'b', '686'), ('622', 'b', '844'), ('794', 'b', '672'), ('388', 'a', '407'), ('438', 'c', '141'), ('641', 'b', '824'), ('16', 'a', '994'), ('312', 'b', '307'), ('180', 'c', '745'), ('724', 'b', '550'), ('760', 'c', '515'), ('391', 'a', '276'), ('938', 'a', '161'), ('521', 'c', '809'), ('771', 'c', '103'), ('801', 'c', '90'), ('603', 'c', '948'), ('1000', 'c', '963'), ('464', 'c', '364'), ('920', 'c', '207'), ('866', 'b', '879'), ('219', 'b', '381'), ('773', 'b', '36'), ('388', 'c', '46'), ('350', 'a', '933'), ('527', 'c', '84'), ('452', 'a', '672'), ('704', 'c', '691'), ('553', 'a', '815'), ('104', 'c', '993'), ('111', 'a', '877'), ('940', 'b', '40'), ('471', 'b', '227'), ('440', 'b', '947'), ('856', 'b', '821'), ('282', 'a', '501'), ('563', 'b', '215'), ('412', 'a', '213'), ('351', 'b', '600'), ('278', 'a', '892'), ('728', 'a', '775'), ('737', 'c', '63'), ('215', 'a', '50'), ('497', 'a', '99'), ('110', 'a', '456'), ('98', 'c', '410'), ('193', 'a', '974'), ('395', 'c', '186'), ('412', 'a', '534'), ('670', 'b', '19'), ('657', 'c', '553'), ('764', 'c', '683'), ('477', 'c', '397'), ('994', 'c', '555'), ('354', 'c', '676'), ('6', 'c', '513'), ('789', 'b', '139'), ('279', 'c', '431'), ('33', 'b', '103'), ('781', 'b', '138'), ('792', 'c', '975'), ('124', 'c', '755'), ('846', 'c', '465'), ('819', 'b', '39'), ('50', 'a', '430'), ('762', 'c', '246'), ('945', 'b', '190'), ('124', 'c', '767'), ('693', 'a', '767'), ('534', 'b', '293'), ('680', 'c', '522'), ('270', 'a', '368'), ('116', 'b', '643'), ('532', 'b', '863'), ('212', 'b', '681'), ('47', 'b', '49'), ('553', 'a', '59'), ('575', 'a', '108'), ('902', 'b', '80'), ('34', 'c', '510'), ('82', 'c', '217'), ('849', 'b', '586'), ('72', 'c', '19'), ('854', 'c', '412'), ('820', 'c', '632'), ('633', 'c', '59'), ('444', 'a', '970'), ('296', 'b', '205'), ('970', 'b', '699'), ('905', 'c', '933'), ('152', 'c', '408'), ('766', 'c', '422'), ('95', 'b', '270'), ('200', 'c', '358'), ('23', 'b', '360'), ('229', 'b', '986'), ('523', 'b', '664'), ('621', 'b', '119'), ('629', 'c', '1'), ('879', 'c', '182'), ('412', 'c', '450'), ('376', 'c', '15'), ('514', 'a', '592'), ('480', 'a', '145'), ('638', 'c', '553'), ('547', 'b', '974'), ('563', 'b', '607'), ('842', 'c', '203'), ('875', 'b', '929'), ('128', 'a', '220'), ('462', 'c', '805'), ('39', 'b', '534'), ('445', 'c', '405'), ('314', 'c', '730'), ('903', 'a', '647'), ('603', 'a', '796'), ('182', 'b', '808'), ('874', 'c', '862'), ('608', 'b', '591'), ('34', 'b', '908'), ('565', 'b', '132'), ('471', 'c', '345'), ('506', 'c', '647'), ('698', 'c', '795'), ('118', 'b', '588'), ('839', 'c', '180'), ('331', 'a', '296'), ('78', 'b', '907'), ('176', 'a', '222'), ('833', 'c', '84'), ('971', 'c', '386'), ('343', 'a', '39'), ('756', 'b', '485'), ('62', 'c', '649'), ('347', 'b', '263'), ('812', 'a', '532'), ('626', 'c', '236'), ('346', 'c', '578'), ('98', 'a', '930'), ('546', 'a', '666'), ('254', 'a', '737'), ('847', 'c', '233'), ('882', 'c', '240'), ('51', 'b', '746'), ('621', 'b', '814'), ('606', 'b', '654'), ('625', 'b', '2'), ('835', 'b', '139'), ('396', 'c', '639'), ('123', 'b', '649'), ('409', 'b', '925'), ('769', 'a', '19'), ('396', 'b', '565'), ('65', 'c', '894'), ('285', 'a', '102'), ('813', 'c', '798'), ('551', 'c', '386'), ('555', 'b', '642'), ('874', 'b', '103'), ('465', 'a', '829'), ('985', 'a', '215'), ('825', 'b', '986'), ('636', 'b', '637'), ('99', 'c', '392'), ('400', 'a', '360'), ('355', 'a', '43'), ('437', 'b', '479'), ('512', 'c', '927'), ('767', 'a', '544'), ('860', 'c', '234'), ('269', 'b', '129'), ('695', 'c', '398'), ('985', 'c', '639'), ('264', 'a', '494'), ('698', 'a', '883'), ('820', 'c', '776'), ('231', 'b', '774'), ('867', 'c', '5'), ('679', 'a', '524'), ('701', 'c', '237'), ('562', 'c', '338'), ('342', 'c', '235'), ('781', 'b', '399'), ('153', 'a', '26'), ('476', 'b', '401'), ('466', 'a', '362'), ('569', 'a', '908'), ('328', 'c', '161'), ('281', 'a', '640'), ('416', 'b', '901'), ('989', 'a', '803'), ('502', 'c', '553'), ('800', 'a', '250'), ('444', 'c', '976'), ('119', 'a', '566'), ('362', 'a', '258'), ('229', 'a', '686'), ('3', 'c', '258'), ('284', 'a', '989'), ('536', 'b', '121'), ('472', 'a', '389'), ('361', 'a', '85'), ('5', 'b', '352'), ('810', 'b', '308'), ('194', 'b', '405'), ('261', 'c', '41'), ('933', 'a', '230'), ('30', 'a', '470'), ('934', 'c', '843'), ('463', 'b', '716'), ('387', 'a', '263'), ('896', 'b', '377'), ('944', 'b', '852'), ('857', 'c', '508'), ('956', 'c', '509'), ('888', 'c', '919'), ('726', 'c', '261'), ('731', 'a', '429'), ('576', 'a', '122'), ('400', 'b', '363'), ('608', 'c', '925'), ('465', 'b', '283'), ('423', 'b', '966'), ('984', 'b', '215'), ('502', 'c', '768'), ('713', 'b', '823'), ('282', 'b', '370'), ('377', 'b', '161'), ('458', 'a', '51'), ('417', 'b', '892'), ('7', 'c', '528'), ('860', 'c', '430'), ('717', 'c', '75'), ('162', 'b', '973'), ('618', 'a', '953'), ('968', 'c', '312'), ('928', 'b', '9'), ('463', 'c', '636'), ('793', 'b', '306'), ('309', 'b', '946'), ('452', 'b', '216'), ('568', 'a', '425'), ('782', 'a', '549'), ('236', 'b', '977'), ('635', 'a', '732'), ('493', 'a', '346'), ('40', 'c', '370'), ('600', 'c', '240'), ('489', 'a', '563'), ('744', 'c', '647'), ('886', 'a', '371'), ('808', 'c', '516'), ('471', 'a', '717'), ('90', 'b', '239'), ('729', 'a', '15'), ('742', 'a', '28'), ('238', 'b', '417'), ('118', 'b', '613'), ('721', 'b', '440'), ('427', 'a', '505'), ('73', 'a', '938'), ('598', 'c', '538'), ('725', 'c', '209'), ('695', 'b', '458'), ('613', 'a', '936'), ('972', 'a', '964'), ('665', 'b', '777'), ('266', 'c', '758'), ('853', 'a', '233'), ('616', 'a', '314'), ('666', 'b', '141'), ('808', 'b', '388'), ('30', 'a', '290'), ('983', 'a', '778'), ('321', 'b', '838'), ('119', 'c', '888'), ('840', 'b', '425'), ('154', 'c', '196'), ('260', 'a', '365'), ('722', 'a', '405'), ('419', 'a', '373'), ('362', 'a', '592'), ('7', 'a', '661'), ('597', 'a', '417'), ('645', 'b', '510'), ('883', 'a', '115'), ('486', 'b', '953'), ('250', 'c', '527'), ('462', 'a', '550'), ('138', 'b', '878'), ('945', 'c', '387'), ('30', 'c', '385'), ('601', 'b', '766'), ('745', 'c', '885'), ('3', 'c', '844'), ('142', 'c', '851'), ('568', 'a', '843'), ('416', 'a', '272'), ('453', 'c', '647'), ('195', 'c', '737'), ('284', 'a', '998'), ('784', 'a', '670'), ('67', 'a', '72'), ('885', 'c', '289'), ('330', 'b', '580'), ('361', 'b', '414'), ('384', 'b', '210'), ('734', 'c', '853'), ('479', 'a', '706'), ('784', 'b', '252'), ('685', 'c', '815'), ('405', 'c', '287'), ('748', 'c', '13'), ('360', 'a', '997'), ('669', 'b', '523'), ('191', 'c', '739'), ('58', 'a', '800'), ('162', 'a', '603'), ('988', 'a', '794'), ('255', 'c', '220'), ('461', 'c', '733'), ('861', 'c', '645'), ('256', 'a', '416'), ('469', 'c', '549'), ('737', 'a', '783'), ('333', 'b', '329'), ('418', 'a', '46'), ('591', 'a', '96'), ('711', 'c', '772'), ('854', 'a', '406'), ('926', 'c', '72'), ('928', 'b', '884'), ('892', 'b', '586'), ('737', 'a', '143'), ('911', 'a', '230'), ('256', 'b', '198'), ('910', 'b', '349'), ('587', 'a', '307'), ('508', 'a', '825'), ('890', 'c', '209'), ('698', 'b', '677'), ('461', 'b', '60'), ('303', 'b', '141'), ('157', 'b', '333'), ('735', 'a', '776'), ('643', 'c', '372'), ('2', 'a', '323'), ('640', 'a', '708'), ('797', 'a', '655'), ('78', 'c', '355'), ('231', 'c', '161'), ('883', 'c', '668'), ('643', 'c', '708'), ('487', 'c', '175'), ('34', 'a', '920'), ('960', 'a', '481'), ('693', 'a', '508'), ('564', 'c', '631'), ('781', 'a', '174'), ('856', 'b', '370'), ('37', 'b', '789'), ('595', 'b', '98'), ('318', 'a', '168'), ('535', 'a', '51'), ('455', 'b', '556'), ('119', 'a', '705'), ('130', 'c', '127'), ('774', 'a', '262'), ('654', 'b', '891'), ('236', 'b', '876'), ('619', 'c', '425'), ('665', 'c', '97'), ('271', 'c', '158'), ('322', 'a', '162'), ('319', 'b', '522'), ('736', 'a', '902'), ('38', 'b', '817'), ('1000', 'b', '391'), ('530', 'a', '854'), ('373', 'a', '674'), ('708', 'b', '701'), ('860', 'b', '748'), ('144', 'b', '128'), ('325', 'b', '478'), ('320', 'c', '298'), ('462', 'b', '949'), ('94', 'a', '591'), ('908', 'a', '138'), ('30', 'a', '330'), ('268', 'c', '483'), ('809', 'c', '288'), ('592', 'b', '155'), ('168', 'c', '843'), ('105', 'a', '543'), ('759', 'c', '379'), ('204', 'a', '80'), ('132', 'c', '19'), ('637', 'c', '345'), ('523', 'c', '982'), ('208', 'c', '291'), ('565', 'c', '827'), ('551', 'a', '240'), ('671', 'a', '116'), ('35', 'c', '585'), ('602', 'c', '506'), ('21', 'a', '677'), ('348', 'a', '672'), ('239', 'b', '353'), ('13', 'a', '733'), ('243', 'c', '849'), ('109', 'a', '114'), ('244', 'b', '919'), ('422', 'b', '681'), ('70', 'b', '874'), ('265', 'a', '404'), ('134', 'b', '969'), ('230', 'b', '76'), ('663', 'a', '173'), ('89', 'a', '960'), ('413', 'a', '417'), ('651', 'b', '607'), ('418', 'a', '352'), ('636', 'a', '661'), ('635', 'b', '941'), ('743', 'b', '921'), ('783', 'a', '126'), ('770', 'b', '816'), ('233', 'a', '807'), ('395', 'c', '374'), ('511', 'a', '416'), ('45', 'a', '547'), ('838', 'a', '650'), ('712', 'c', '187'), ('988', 'b', '546'), ('76', 'b', '623'), ('724', 'b', '313'), ('150', 'c', '20'), ('740', 'b', '559'), ('344', 'b', '774'), ('332', 'c', '794'), ('698', 'c', '78'), ('151', 'b', '900'), ('690', 'b', '517'), ('676', 'c', '293'), ('126', 'c', '771'), ('377', 'a', '731'), ('353', 'c', '590'), ('579', 'a', '931'), ('50', 'c', '241'), ('593', 'c', '545'), ('750', 'b', '554'), ('53', 'b', '278'), ('222', 'a', '417'), ('396', 'b', '395'), ('874', 'c', '711'), ('34', 'b', '67'), ('622', 'a', '576'), ('923', 'a', '287'), ('182', 'b', '872'), ('275', 'a', '802'), ('479', 'c', '797'), ('531', 'c', '240'), ('200', 'a', '249'), ('318', 'a', '203'), ('413', 'c', '946'), ('728', 'b', '960'), ('272', 'b', '408'), ('454', 'a', '884'), ('695', 'c', '249'), ('51', 'a', '344'), ('409', 'b', '759'), ('888', 'c', '326'), ('218', 'a', '127'), ('518', 'a', '776'), ('200', 'c', '913'), ('48', 'c', '201'), ('51', 'a', '558'), ('694', 'a', '177'), ('359', 'b', '507'), ('872', 'b', '545'), ('915', 'c', '372'), ('710', 'b', '928'), ('651', 'b', '28'), ('419', 'a', '278'), ('969', 'c', '694'), ('378', 'b', '514'), ('817', 'b', '144'), ('46', 'b', '385'), ('483', 'b', '711'), ('112', 'c', '928'), ('683', 'c', '174'), ('44', 'b', '880'), ('287', 'a', '737'), ('75', 'c', '379'), ('460', 'c', '770'), ('362', 'a', '773'), ('257', 'c', '408'), ('726', 'a', '262'), ('553', 'c', '562'), ('412', 'b', '674'), ('218', 'b', '248'), ('425', 'a', '960'), ('246', 'b', '905'), ('763', 'c', '317'), ('40', 'b', '295'), ('501', 'a', '435'), ('257', 'a', '90'), ('229', 'b', '330'), ('176', 'c', '454'), ('174', 'c', '850'), ('104', 'a', '837'), ('933', 'c', '447'), ('734', 'a', '165'), ('896', 'a', '790'), ('512', 'b', '583'), ('217', 'a', '183'), ('217', 'b', '968'), ('673', 'b', '173'), ('701', 'a', '635'), ('629', 'b', '357'), ('119', 'b', '364'), ('681', 'c', '373'), ('904', 'c', '381'), ('988', 'c', '892'), ('274', 'c', '652'), ('121', 'a', '627'), ('338', 'c', '102'), ('397', 'c', '354'), ('211', 'c', '633'), ('556', 'a', '848'), ('20', 'b', '387'), ('270', 'c', '21'), ('40', 'b', '329'), ('295', 'a', '77'), ('557', 'c', '49'), ('839', 'b', '483'), ('43', 'c', '264'), ('557', 'c', '968'), ('254', 'b', '575'), ('773', 'a', '420'), ('217', 'b', '450'), ('712', 'c', '861'), ('935', 'b', '662'), ('459', 'b', '814'), ('150', 'b', '296'), ('894', 'c', '522'), ('119', 'c', '129'), ('949', 'c', '853'), ('263', 'c', '126'), ('475', 'b', '385'), ('344', 'b', '888'), ('157', 'c', '683'), ('145', 'c', '689'), ('753', 'a', '952'), ('910', 'c', '838'), ('576', 'b', '178'), ('24', 'c', '825'), ('133', 'c', '568'), ('305', 'b', '966'), ('621', 'a', '892'), ('213', 'c', '894'), ('287', 'c', '717'), ('720', 'b', '277'), ('915', 'a', '389'), ('757', 'b', '291'), ('290', 'a', '347'), ('331', 'b', '530'), ('501', 'b', '283'), ('510', 'b', '18'), ('403', 'a', '627'), ('667', 'c', '379'), ('750', 'a', '537'), ('699', 'b', '446'), ('511', 'b', '486'), ('155', 'c', '869'), ('723', 'c', '936'), ('112', 'b', '654'), ('462', 'c', '806'), ('981', 'a', '593'), ('861', 'b', '267'), ('390', 'b', '24'), ('19', 'a', '196'), ('472', 'b', '802'), ('379', 'c', '619'), ('765', 'b', '302'), ('526', 'a', '970'), ('313', 'a', '862'), ('574', 'b', '592'), ('612', 'a', '552'), ('431', 'b', '329'), ('752', 'b', '672'), ('986', 'c', '968'), ('59', 'c', '144'), ('242', 'c', '7'), ('709', 'c', '955'), ('867', 'c', '49'), ('290', 'a', '41'), ('111', 'b', '598'), ('828', 'c', '874'), ('715', 'c', '119'), ('962', 'c', '850'), ('778', 'a', '603'), ('673', 'b', '737'), ('370', 'b', '853'), ('747', 'b', '143'), ('856', 'a', '752'), ('832', 'c', '746'), ('52', 'c', '602'), ('555', 'b', '906'), ('484', 'b', '969'), ('656', 'b', '613'), ('280', 'a', '185'), ('534', 'a', '767'), ('915', 'c', '435'), ('990', 'c', '833'), ('182', 'a', '724'), ('492', 'b', '705'), ('266', 'b', '449'), ('842', 'b', '909'), ('349', 'a', '305'), ('677', 'b', '414'), ('993', 'b', '628'), ('783', 'b', '889'), ('12', 'b', '553'), ('338', 'b', '586'), ('944', 'c', '582'), ('182', 'a', '104'), ('151', 'b', '753'), ('741', 'c', '539'), ('78', 'a', '754'), ('409', 'a', '159'), ('312', 'c', '65'), ('87', 'b', '496'), ('912', 'c', '277'), ('618', 'a', '170'), ('291', 'c', '717'), ('27', 'a', '770'), ('834', 'c', '382'), ('665', 'b', '550'), ('645', 'b', '547'), ('506', 'b', '109'), ('163', 'c', '105'), ('446', 'b', '3'), ('69', 'b', '127'), ('195', 'c', '566'), ('535', 'c', '439'), ('375', 'a', '150'), ('10', 'c', '50'), ('868', 'c', '946'), ('732', 'a', '854'), ('684', 'c', '139'), ('586', 'c', '92'), ('984', 'b', '137');
select count(*) from graph
/////////////////// (a+/b)/b+
// after
EXPLAIN ANALYZE
WITH RECURSIVE cte_1(x, y) AS(
SELECT g.x, g.y
FROM graph g
WHERE g.r = 'a'
),
cte_2(x, y) AS(
SELECT g.x, g.y
FROM graph g
WHERE g.r = 'b'
),
cte_3(x, y) AS(
SELECT l.x, r.y
FROM cte_1 l, cte_2 r
WHERE l.y = r.x
),
cte_4(x, y) AS(
SELECT x, y
FROM cte_3 g
UNION
SELECT g.x, c.y
FROM cte_4 c, cte_1 g
WHERE g.y = c.x
),
cte_5(x, y) AS(
SELECT g.x, g.y
FROM graph g
WHERE g.r = 'b'
),
cte_6(x, y) AS(
SELECT l.x, r.y
FROM cte_4 l, cte_5 r
WHERE l.y = r.x
),
cte_7(x, y) AS(
SELECT x, y
FROM cte_6 g
UNION
SELECT c.x, g.y
FROM cte_7 c, cte_5 g
WHERE c.y = g.x
)
SELECT x,y FROM cte_7
// Execution Time: 2.889 ms
// before
EXPLAIN ANALYZE
WITH RECURSIVE cte_1(x, y) AS(
SELECT g.x, g.y
FROM graph g
WHERE g.r = 'a'
),
cte_2(x, y) AS(
SELECT x, y
FROM cte_1 g
UNION
SELECT c.x, g.y
FROM cte_2 c, cte_1 g
WHERE c.y = g.x
),
cte_3(x, y) AS(
SELECT g.x, g.y
FROM graph g
WHERE g.r = 'b'
),
cte_4(x, y) AS(
SELECT l.x, r.y
FROM cte_2 l, cte_3 r
WHERE l.y = r.x
),
cte_5(x, y) AS(
SELECT g.x, g.y
FROM graph g
WHERE g.r = 'b'
),
cte_6(x, y) AS(
SELECT x, y
FROM cte_5 g
UNION
SELECT c.x, g.y
FROM cte_6 c, cte_5 g
WHERE c.y = g.x
),
cte_7(x, y) AS(
SELECT l.x, r.y
FROM cte_4 l, cte_6 r
WHERE l.y = r.x
)
SELECT x,y FROM cte_7
// Execution Time: 3.575 ms
/////////////////////////// a+/b
// after
EXPLAIN ANALYZE
WITH RECURSIVE cte_1(x, y) AS(
SELECT g.x, g.y
FROM graph g
WHERE g.r = 'a'
),
cte_2(x, y) AS(
SELECT g.x, g.y
FROM graph g
WHERE g.r = 'b'
),
cte_3(x, y) AS(
SELECT l.x, r.y
FROM cte_1 l, cte_2 r
WHERE l.y = r.x
),
cte_4(x, y) AS(
SELECT x, y
FROM cte_3 g
UNION
SELECT g.x, c.y
FROM cte_4 c, cte_1 g
WHERE g.y = c.x
)
SELECT x,y FROM cte_4
// Execution Time: 1.317 ms
// before
EXPLAIN ANALYZE
WITH RECURSIVE cte_1(x, y) AS(
SELECT g.x, g.y
FROM graph g
WHERE g.r = 'a'
),
cte_2(x, y) AS(
SELECT x, y
FROM cte_1 g
UNION
SELECT c.x, g.y
FROM cte_2 c, cte_1 g
WHERE c.y = g.x
),
cte_3(x, y) AS(
SELECT g.x, g.y
FROM graph g
WHERE g.r = 'b'
),
cte_4(x, y) AS(
SELECT l.x, r.y
FROM cte_2 l, cte_3 r
WHERE l.y = r.x
)
SELECT x,y FROM cte_4
// Execution Time: 1.589 ms
/////////////////////////// (a+/b)+/(b+/c+)
// after
EXPLAIN ANALYZE
WITH RECURSIVE cte_1(x, y) AS(
SELECT g.x, g.y
FROM graph g
WHERE g.r = 'a'
),
cte_2(x, y) AS(
SELECT g.x, g.y
FROM graph g
WHERE g.r = 'b'
),
cte_3(x, y) AS(
SELECT l.x, r.y
FROM cte_1 l, cte_2 r
WHERE l.y = r.x
),
cte_4(x, y) AS(
SELECT x, y
FROM cte_3 g
UNION
SELECT g.x, c.y
FROM cte_4 c, cte_1 g
WHERE g.y = c.x
),
cte_5(x, y) AS(
SELECT g.x, g.y
FROM graph g
WHERE g.r = 'b'
),
cte_6(x, y) AS(
SELECT g.x, g.y
FROM graph g
WHERE g.r = 'c'
),
cte_7(x, y) AS(
SELECT l.x, r.y
FROM cte_5 l, cte_6 r
WHERE l.y = r.x
),
cte_8(x, y) AS(
SELECT x, y
FROM cte_7 g
UNION
SELECT g.x, c.y
FROM cte_8 c, cte_5 g
WHERE g.y = c.x
),
cte_9(x, y) AS(
SELECT x, y
FROM cte_8 g
UNION
SELECT c.x, g.y
FROM cte_9 c, cte_6 g
WHERE c.y = g.x
),
cte_10(x, y) AS(
SELECT l.x, r.y
FROM cte_4 l, cte_9 r
WHERE l.y = r.x
),
cte_11(x, y) AS(
SELECT x, y
FROM cte_10 g
UNION
SELECT g.x, c.y
FROM cte_11 c, cte_8 g
WHERE g.y = c.x
)
SELECT x,y FROM cte_11
// Execution Time: 8.156 ms
// before
EXPLAIN ANALYZE
WITH RECURSIVE cte_1(x, y) AS(
SELECT g.x, g.y
FROM graph g
WHERE g.r = 'a'
),
cte_2(x, y) AS(
SELECT x, y
FROM cte_1 g
UNION
SELECT c.x, g.y
FROM cte_2 c, cte_1 g
WHERE c.y = g.x
),
cte_3(x, y) AS(
SELECT g.x, g.y
FROM graph g
WHERE g.r = 'b'
),
cte_4(x, y) AS(
SELECT l.x, r.y
FROM cte_2 l, cte_3 r
WHERE l.y = r.x
),
cte_5(x, y) AS(
SELECT x, y
FROM cte_4 g
UNION
SELECT c.x, g.y
FROM cte_5 c, cte_4 g
WHERE c.y = g.x
),
cte_6(x, y) AS(
SELECT g.x, g.y
FROM graph g
WHERE g.r = 'b'
),
cte_7(x, y) AS(
SELECT x, y
FROM cte_6 g
UNION
SELECT c.x, g.y
FROM cte_7 c, cte_6 g
WHERE c.y = g.x
),
cte_8(x, y) AS(
SELECT g.x, g.y
FROM graph g
WHERE g.r = 'c'
),
cte_9(x, y) AS(
SELECT x, y
FROM cte_8 g
UNION
SELECT c.x, g.y
FROM cte_9 c, cte_8 g
WHERE c.y = g.x
),
cte_10(x, y) AS(
SELECT l.x, r.y
FROM cte_7 l, cte_9 r
WHERE l.y = r.x
),
cte_11(x, y) AS(
SELECT l.x, r.y
FROM cte_5 l, cte_10 r
WHERE l.y = r.x
)
SELECT x,y FROM cte_11
// Execution Time: 10.178 ms