-
Notifications
You must be signed in to change notification settings - Fork 18
/
queries.sql
2719 lines (2627 loc) · 186 KB
/
queries.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
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.9 (Ubuntu 10.9-0ubuntu0.18.04.1)
-- Dumped by pg_dump version 10.9 (Ubuntu 10.9-0ubuntu0.18.04.1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Data for Name: queries; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (1, '22b.sql', 11, 'SELECT MIN(cn.name) AS movie_company,
MIN(mi_idx.info) AS rating,
MIN(t.title) AS western_violent_movie
FROM company_name AS cn,
company_type AS ct,
info_type AS it1,
info_type AS it2,
keyword AS k,
kind_type AS kt,
movie_companies AS mc,
movie_info AS mi,
movie_info_idx AS mi_idx,
movie_keyword AS mk,
title AS t
WHERE cn.country_code != ''[us]''
AND it1.info = ''countries''
AND it2.info = ''rating''
AND k.keyword IN (''murder'',
''murder-in-title'',
''blood'',
''violence'')
AND kt.kind IN (''movie'',
''episode'')
AND mc.note NOT LIKE ''%(USA)%''
AND mc.note LIKE ''%(200%)%''
AND mi.info IN (''Germany'',
''German'',
''USA'',
''American'')
AND mi_idx.info < ''7.0''
AND t.production_year > 2009
AND kt.id = t.kind_id
AND t.id = mi.movie_id
AND t.id = mk.movie_id
AND t.id = mi_idx.movie_id
AND t.id = mc.movie_id
AND mk.movie_id = mi.movie_id
AND mk.movie_id = mi_idx.movie_id
AND mk.movie_id = mc.movie_id
AND mi.movie_id = mi_idx.movie_id
AND mi.movie_id = mc.movie_id
AND mc.movie_id = mi_idx.movie_id
AND k.id = mk.keyword_id
AND it1.id = mi.info_type_id
AND it2.id = mi_idx.info_type_id
AND ct.id = mc.company_type_id
AND cn.id = mc.company_id;
', '{"select": [{"value": {"min": "cn.name"}, "name": "movie_company"}, {"value": {"min": "mi_idx.info"}, "name": "rating"}, {"value": {"min": "t.title"}, "name": "western_violent_movie"}], "from": [{"value": "company_name", "name": "cn"}, {"value": "company_type", "name": "ct"}, {"value": "info_type", "name": "it1"}, {"value": "info_type", "name": "it2"}, {"value": "keyword", "name": "k"}, {"value": "kind_type", "name": "kt"}, {"value": "movie_companies", "name": "mc"}, {"value": "movie_info", "name": "mi"}, {"value": "movie_info_idx", "name": "mi_idx"}, {"value": "movie_keyword", "name": "mk"}, {"value": "title", "name": "t"}], "where": {"and": [{"neq": ["cn.country_code", {"literal": "[us]"}]}, {"eq": ["it1.info", {"literal": "countries"}]}, {"eq": ["it2.info", {"literal": "rating"}]}, {"in": ["k.keyword", {"literal": ["murder", "murder-in-title", "blood", "violence"]}]}, {"in": ["kt.kind", {"literal": ["movie", "episode"]}]}, {"nlike": ["mc.note", {"literal": "%(USA)%"}]}, {"like": ["mc.note", {"literal": "%(200%)%"}]}, {"in": ["mi.info", {"literal": ["Germany", "German", "USA", "American"]}]}, {"lt": ["mi_idx.info", {"literal": "7.0"}]}, {"gt": ["t.production_year", 2009]}, {"eq": ["kt.id", "t.kind_id"]}, {"eq": ["t.id", "mi.movie_id"]}, {"eq": ["t.id", "mk.movie_id"]}, {"eq": ["t.id", "mi_idx.movie_id"]}, {"eq": ["t.id", "mc.movie_id"]}, {"eq": ["mk.movie_id", "mi.movie_id"]}, {"eq": ["mk.movie_id", "mi_idx.movie_id"]}, {"eq": ["mk.movie_id", "mc.movie_id"]}, {"eq": ["mi.movie_id", "mi_idx.movie_id"]}, {"eq": ["mi.movie_id", "mc.movie_id"]}, {"eq": ["mc.movie_id", "mi_idx.movie_id"]}, {"eq": ["k.id", "mk.keyword_id"]}, {"eq": ["it1.id", "mi.info_type_id"]}, {"eq": ["it2.id", "mi_idx.info_type_id"]}, {"eq": ["ct.id", "mc.company_type_id"]}, {"eq": ["cn.id", "mc.company_id"]}]}}', 30.5090008, 1086.32605, 7476.10986);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (2, '8a.sql', 7, 'SELECT MIN(an1.name) AS actress_pseudonym,
MIN(t.title) AS japanese_movie_dubbed
FROM aka_name AS an1,
cast_info AS ci,
company_name AS cn,
movie_companies AS mc,
name AS n1,
role_type AS rt,
title AS t
WHERE ci.note =''(voice: English version)''
AND cn.country_code =''[jp]''
AND mc.note LIKE ''%(Japan)%''
AND mc.note NOT LIKE ''%(USA)%''
AND n1.name LIKE ''%Yo%''
AND n1.name NOT LIKE ''%Yu%''
AND rt.role =''actress''
AND an1.person_id = n1.id
AND n1.id = ci.person_id
AND ci.movie_id = t.id
AND t.id = mc.movie_id
AND mc.company_id = cn.id
AND ci.role_id = rt.id
AND an1.person_id = ci.person_id
AND ci.movie_id = mc.movie_id;
', '{"select": [{"value": {"min": "an1.name"}, "name": "actress_pseudonym"}, {"value": {"min": "t.title"}, "name": "japanese_movie_dubbed"}], "from": [{"value": "aka_name", "name": "an1"}, {"value": "cast_info", "name": "ci"}, {"value": "company_name", "name": "cn"}, {"value": "movie_companies", "name": "mc"}, {"value": "name", "name": "n1"}, {"value": "role_type", "name": "rt"}, {"value": "title", "name": "t"}], "where": {"and": [{"eq": ["ci.note", {"literal": "(voice: English version)"}]}, {"eq": ["cn.country_code", {"literal": "[jp]"}]}, {"like": ["mc.note", {"literal": "%(Japan)%"}]}, {"nlike": ["mc.note", {"literal": "%(USA)%"}]}, {"like": ["n1.name", {"literal": "%Yo%"}]}, {"nlike": ["n1.name", {"literal": "%Yu%"}]}, {"eq": ["rt.role", {"literal": "actress"}]}, {"eq": ["an1.person_id", "n1.id"]}, {"eq": ["n1.id", "ci.person_id"]}, {"eq": ["ci.movie_id", "t.id"]}, {"eq": ["t.id", "mc.movie_id"]}, {"eq": ["mc.company_id", "cn.id"]}, {"eq": ["ci.role_id", "rt.id"]}, {"eq": ["an1.person_id", "ci.person_id"]}, {"eq": ["ci.movie_id", "mc.movie_id"]}]}}', 16.4290009, 3667.21899, 43245.7188);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (3, '18c.sql', 7, 'SELECT MIN(mi.info) AS movie_budget,
MIN(mi_idx.info) AS movie_votes,
MIN(t.title) AS movie_title
FROM cast_info AS ci,
info_type AS it1,
info_type AS it2,
movie_info AS mi,
movie_info_idx AS mi_idx,
name AS n,
title AS t
WHERE ci.note IN (''(writer)'',
''(head writer)'',
''(written by)'',
''(story)'',
''(story editor)'')
AND it1.info = ''genres''
AND it2.info = ''votes''
AND mi.info IN (''Horror'',
''Action'',
''Sci-Fi'',
''Thriller'',
''Crime'',
''War'')
AND n.gender = ''m''
AND t.id = mi.movie_id
AND t.id = mi_idx.movie_id
AND t.id = ci.movie_id
AND ci.movie_id = mi.movie_id
AND ci.movie_id = mi_idx.movie_id
AND mi.movie_id = mi_idx.movie_id
AND n.id = ci.person_id
AND it1.id = mi.info_type_id
AND it2.id = mi_idx.info_type_id;
', '{"select": [{"value": {"min": "mi.info"}, "name": "movie_budget"}, {"value": {"min": "mi_idx.info"}, "name": "movie_votes"}, {"value": {"min": "t.title"}, "name": "movie_title"}], "from": [{"value": "cast_info", "name": "ci"}, {"value": "info_type", "name": "it1"}, {"value": "info_type", "name": "it2"}, {"value": "movie_info", "name": "mi"}, {"value": "movie_info_idx", "name": "mi_idx"}, {"value": "name", "name": "n"}, {"value": "title", "name": "t"}], "where": {"and": [{"in": ["ci.note", {"literal": ["(writer)", "(head writer)", "(written by)", "(story)", "(story editor)"]}]}, {"eq": ["it1.info", {"literal": "genres"}]}, {"eq": ["it2.info", {"literal": "votes"}]}, {"in": ["mi.info", {"literal": ["Horror", "Action", "Sci-Fi", "Thriller", "Crime", "War"]}]}, {"eq": ["n.gender", {"literal": "m"}]}, {"eq": ["t.id", "mi.movie_id"]}, {"eq": ["t.id", "mi_idx.movie_id"]}, {"eq": ["t.id", "ci.movie_id"]}, {"eq": ["ci.movie_id", "mi.movie_id"]}, {"eq": ["ci.movie_id", "mi_idx.movie_id"]}, {"eq": ["mi.movie_id", "mi_idx.movie_id"]}, {"eq": ["n.id", "ci.person_id"]}, {"eq": ["it1.id", "mi.info_type_id"]}, {"eq": ["it2.id", "mi_idx.info_type_id"]}]}}', 2.47799993, 7185.18701, 96954.0078);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (4, '6b.sql', 5, 'SELECT MIN(k.keyword) AS movie_keyword,
MIN(n.name) AS actor_name,
MIN(t.title) AS hero_movie
FROM cast_info AS ci,
keyword AS k,
movie_keyword AS mk,
name AS n,
title AS t
WHERE k.keyword IN (''superhero'',
''sequel'',
''second-part'',
''marvel-comics'',
''based-on-comic'',
''tv-special'',
''fight'',
''violence'')
AND n.name LIKE ''%Downey%Robert%''
AND t.production_year > 2014
AND k.id = mk.keyword_id
AND t.id = mk.movie_id
AND t.id = ci.movie_id
AND ci.movie_id = mk.movie_id
AND n.id = ci.person_id;
', '{"select": [{"value": {"min": "k.keyword"}, "name": "movie_keyword"}, {"value": {"min": "n.name"}, "name": "actor_name"}, {"value": {"min": "t.title"}, "name": "hero_movie"}], "from": [{"value": "cast_info", "name": "ci"}, {"value": "keyword", "name": "k"}, {"value": "movie_keyword", "name": "mk"}, {"value": "name", "name": "n"}, {"value": "title", "name": "t"}], "where": {"and": [{"in": ["k.keyword", {"literal": ["superhero", "sequel", "second-part", "marvel-comics", "based-on-comic", "tv-special", "fight", "violence"]}]}, {"like": ["n.name", {"literal": "%Downey%Robert%"}]}, {"gt": ["t.production_year", 2014]}, {"eq": ["k.id", "mk.keyword_id"]}, {"eq": ["t.id", "mk.movie_id"]}, {"eq": ["t.id", "ci.movie_id"]}, {"eq": ["ci.movie_id", "mk.movie_id"]}, {"eq": ["n.id", "ci.person_id"]}]}}', 0.92900002, 380.635986, 12345.71);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (5, '16a.sql', 8, 'SELECT MIN(an.name) AS cool_actor_pseudonym,
MIN(t.title) AS series_named_after_char
FROM aka_name AS an,
cast_info AS ci,
company_name AS cn,
keyword AS k,
movie_companies AS mc,
movie_keyword AS mk,
name AS n,
title AS t
WHERE cn.country_code =''[us]''
AND k.keyword =''character-name-in-title''
AND t.episode_nr >= 50
AND t.episode_nr < 100
AND an.person_id = n.id
AND n.id = ci.person_id
AND ci.movie_id = t.id
AND t.id = mk.movie_id
AND mk.keyword_id = k.id
AND t.id = mc.movie_id
AND mc.company_id = cn.id
AND an.person_id = ci.person_id
AND ci.movie_id = mc.movie_id
AND ci.movie_id = mk.movie_id
AND mc.movie_id = mk.movie_id;
', '{"select": [{"value": {"min": "an.name"}, "name": "cool_actor_pseudonym"}, {"value": {"min": "t.title"}, "name": "series_named_after_char"}], "from": [{"value": "aka_name", "name": "an"}, {"value": "cast_info", "name": "ci"}, {"value": "company_name", "name": "cn"}, {"value": "keyword", "name": "k"}, {"value": "movie_companies", "name": "mc"}, {"value": "movie_keyword", "name": "mk"}, {"value": "name", "name": "n"}, {"value": "title", "name": "t"}], "where": {"and": [{"eq": ["cn.country_code", {"literal": "[us]"}]}, {"eq": ["k.keyword", {"literal": "character-name-in-title"}]}, {"gte": ["t.episode_nr", 50]}, {"lt": ["t.episode_nr", 100]}, {"eq": ["an.person_id", "n.id"]}, {"eq": ["n.id", "ci.person_id"]}, {"eq": ["ci.movie_id", "t.id"]}, {"eq": ["t.id", "mk.movie_id"]}, {"eq": ["mk.keyword_id", "k.id"]}, {"eq": ["t.id", "mc.movie_id"]}, {"eq": ["mc.company_id", "cn.id"]}, {"eq": ["an.person_id", "ci.person_id"]}, {"eq": ["ci.movie_id", "mc.movie_id"]}, {"eq": ["ci.movie_id", "mk.movie_id"]}, {"eq": ["mc.movie_id", "mk.movie_id"]}]}}', 4.16099977, 282.002014, 3805.07007);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (6, '17f.sql', 7, 'SELECT MIN(n.name) AS member_in_charnamed_movie
FROM cast_info AS ci,
company_name AS cn,
keyword AS k,
movie_companies AS mc,
movie_keyword AS mk,
name AS n,
title AS t
WHERE k.keyword =''character-name-in-title''
AND n.name LIKE ''%B%''
AND n.id = ci.person_id
AND ci.movie_id = t.id
AND t.id = mk.movie_id
AND mk.keyword_id = k.id
AND t.id = mc.movie_id
AND mc.company_id = cn.id
AND ci.movie_id = mc.movie_id
AND ci.movie_id = mk.movie_id
AND mc.movie_id = mk.movie_id;
', '{"select": {"value": {"min": "n.name"}, "name": "member_in_charnamed_movie"}, "from": [{"value": "cast_info", "name": "ci"}, {"value": "company_name", "name": "cn"}, {"value": "keyword", "name": "k"}, {"value": "movie_companies", "name": "mc"}, {"value": "movie_keyword", "name": "mk"}, {"value": "name", "name": "n"}, {"value": "title", "name": "t"}], "where": {"and": [{"eq": ["k.keyword", {"literal": "character-name-in-title"}]}, {"like": ["n.name", {"literal": "%B%"}]}, {"eq": ["n.id", "ci.person_id"]}, {"eq": ["ci.movie_id", "t.id"]}, {"eq": ["t.id", "mk.movie_id"]}, {"eq": ["mk.keyword_id", "k.id"]}, {"eq": ["t.id", "mc.movie_id"]}, {"eq": ["mc.company_id", "cn.id"]}, {"eq": ["ci.movie_id", "mc.movie_id"]}, {"eq": ["ci.movie_id", "mk.movie_id"]}, {"eq": ["mc.movie_id", "mk.movie_id"]}]}}', 2.44199991, 13212.915, 4640.56006);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (7, '25c.sql', 9, 'SELECT MIN(mi.info) AS movie_budget,
MIN(mi_idx.info) AS movie_votes,
MIN(n.name) AS male_writer,
MIN(t.title) AS violent_movie_title
FROM cast_info AS ci,
info_type AS it1,
info_type AS it2,
keyword AS k,
movie_info AS mi,
movie_info_idx AS mi_idx,
movie_keyword AS mk,
name AS n,
title AS t
WHERE ci.note IN (''(writer)'',
''(head writer)'',
''(written by)'',
''(story)'',
''(story editor)'')
AND it1.info = ''genres''
AND it2.info = ''votes''
AND k.keyword IN (''murder'',
''violence'',
''blood'',
''gore'',
''death'',
''female-nudity'',
''hospital'')
AND mi.info IN (''Horror'',
''Action'',
''Sci-Fi'',
''Thriller'',
''Crime'',
''War'')
AND n.gender = ''m''
AND t.id = mi.movie_id
AND t.id = mi_idx.movie_id
AND t.id = ci.movie_id
AND t.id = mk.movie_id
AND ci.movie_id = mi.movie_id
AND ci.movie_id = mi_idx.movie_id
AND ci.movie_id = mk.movie_id
AND mi.movie_id = mi_idx.movie_id
AND mi.movie_id = mk.movie_id
AND mi_idx.movie_id = mk.movie_id
AND n.id = ci.person_id
AND it1.id = mi.info_type_id
AND it2.id = mi_idx.info_type_id
AND k.id = mk.keyword_id;
', '{"select": [{"value": {"min": "mi.info"}, "name": "movie_budget"}, {"value": {"min": "mi_idx.info"}, "name": "movie_votes"}, {"value": {"min": "n.name"}, "name": "male_writer"}, {"value": {"min": "t.title"}, "name": "violent_movie_title"}], "from": [{"value": "cast_info", "name": "ci"}, {"value": "info_type", "name": "it1"}, {"value": "info_type", "name": "it2"}, {"value": "keyword", "name": "k"}, {"value": "movie_info", "name": "mi"}, {"value": "movie_info_idx", "name": "mi_idx"}, {"value": "movie_keyword", "name": "mk"}, {"value": "name", "name": "n"}, {"value": "title", "name": "t"}], "where": {"and": [{"in": ["ci.note", {"literal": ["(writer)", "(head writer)", "(written by)", "(story)", "(story editor)"]}]}, {"eq": ["it1.info", {"literal": "genres"}]}, {"eq": ["it2.info", {"literal": "votes"}]}, {"in": ["k.keyword", {"literal": ["murder", "violence", "blood", "gore", "death", "female-nudity", "hospital"]}]}, {"in": ["mi.info", {"literal": ["Horror", "Action", "Sci-Fi", "Thriller", "Crime", "War"]}]}, {"eq": ["n.gender", {"literal": "m"}]}, {"eq": ["t.id", "mi.movie_id"]}, {"eq": ["t.id", "mi_idx.movie_id"]}, {"eq": ["t.id", "ci.movie_id"]}, {"eq": ["t.id", "mk.movie_id"]}, {"eq": ["ci.movie_id", "mi.movie_id"]}, {"eq": ["ci.movie_id", "mi_idx.movie_id"]}, {"eq": ["ci.movie_id", "mk.movie_id"]}, {"eq": ["mi.movie_id", "mi_idx.movie_id"]}, {"eq": ["mi.movie_id", "mk.movie_id"]}, {"eq": ["mi_idx.movie_id", "mk.movie_id"]}, {"eq": ["n.id", "ci.person_id"]}, {"eq": ["it1.id", "mi.info_type_id"]}, {"eq": ["it2.id", "mi_idx.info_type_id"]}, {"eq": ["k.id", "mk.keyword_id"]}]}}', 9.17300034, 8416.57715, 9233.78027);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (9, '1d.sql', 5, 'SELECT MIN(mc.note) AS production_note,
MIN(t.title) AS movie_title,
MIN(t.production_year) AS movie_year
FROM company_type AS ct,
info_type AS it,
movie_companies AS mc,
movie_info_idx AS mi_idx,
title AS t
WHERE ct.kind = ''production companies''
AND it.info = ''bottom 10 rank''
AND mc.note NOT LIKE ''%(as Metro-Goldwyn-Mayer Pictures)%''
AND t.production_year >2000
AND ct.id = mc.company_type_id
AND t.id = mc.movie_id
AND t.id = mi_idx.movie_id
AND mc.movie_id = mi_idx.movie_id
AND it.id = mi_idx.info_type_id;
', '{"select": [{"value": {"min": "mc.note"}, "name": "production_note"}, {"value": {"min": "t.title"}, "name": "movie_title"}, {"value": {"min": "t.production_year"}, "name": "movie_year"}], "from": [{"value": "company_type", "name": "ct"}, {"value": "info_type", "name": "it"}, {"value": "movie_companies", "name": "mc"}, {"value": "movie_info_idx", "name": "mi_idx"}, {"value": "title", "name": "t"}], "where": {"and": [{"eq": ["ct.kind", {"literal": "production companies"}]}, {"eq": ["it.info", {"literal": "bottom 10 rank"}]}, {"nlike": ["mc.note", {"literal": "%(as Metro-Goldwyn-Mayer Pictures)%"}]}, {"gt": ["t.production_year", 2000]}, {"eq": ["ct.id", "mc.company_type_id"]}, {"eq": ["t.id", "mc.movie_id"]}, {"eq": ["t.id", "mi_idx.movie_id"]}, {"eq": ["mc.movie_id", "mi_idx.movie_id"]}, {"eq": ["it.id", "mi_idx.info_type_id"]}]}}', 2.50099993, 66.2750015, 19621.0508);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (11, '22a.sql', 11, 'SELECT MIN(cn.name) AS movie_company,
MIN(mi_idx.info) AS rating,
MIN(t.title) AS western_violent_movie
FROM company_name AS cn,
company_type AS ct,
info_type AS it1,
info_type AS it2,
keyword AS k,
kind_type AS kt,
movie_companies AS mc,
movie_info AS mi,
movie_info_idx AS mi_idx,
movie_keyword AS mk,
title AS t
WHERE cn.country_code != ''[us]''
AND it1.info = ''countries''
AND it2.info = ''rating''
AND k.keyword IN (''murder'',
''murder-in-title'',
''blood'',
''violence'')
AND kt.kind IN (''movie'',
''episode'')
AND mc.note NOT LIKE ''%(USA)%''
AND mc.note LIKE ''%(200%)%''
AND mi.info IN (''Germany'',
''German'',
''USA'',
''American'')
AND mi_idx.info < ''7.0''
AND t.production_year > 2008
AND kt.id = t.kind_id
AND t.id = mi.movie_id
AND t.id = mk.movie_id
AND t.id = mi_idx.movie_id
AND t.id = mc.movie_id
AND mk.movie_id = mi.movie_id
AND mk.movie_id = mi_idx.movie_id
AND mk.movie_id = mc.movie_id
AND mi.movie_id = mi_idx.movie_id
AND mi.movie_id = mc.movie_id
AND mc.movie_id = mi_idx.movie_id
AND k.id = mk.keyword_id
AND it1.id = mi.info_type_id
AND it2.id = mi_idx.info_type_id
AND ct.id = mc.company_type_id
AND cn.id = mc.company_id;
', '{"select": [{"value": {"min": "cn.name"}, "name": "movie_company"}, {"value": {"min": "mi_idx.info"}, "name": "rating"}, {"value": {"min": "t.title"}, "name": "western_violent_movie"}], "from": [{"value": "company_name", "name": "cn"}, {"value": "company_type", "name": "ct"}, {"value": "info_type", "name": "it1"}, {"value": "info_type", "name": "it2"}, {"value": "keyword", "name": "k"}, {"value": "kind_type", "name": "kt"}, {"value": "movie_companies", "name": "mc"}, {"value": "movie_info", "name": "mi"}, {"value": "movie_info_idx", "name": "mi_idx"}, {"value": "movie_keyword", "name": "mk"}, {"value": "title", "name": "t"}], "where": {"and": [{"neq": ["cn.country_code", {"literal": "[us]"}]}, {"eq": ["it1.info", {"literal": "countries"}]}, {"eq": ["it2.info", {"literal": "rating"}]}, {"in": ["k.keyword", {"literal": ["murder", "murder-in-title", "blood", "violence"]}]}, {"in": ["kt.kind", {"literal": ["movie", "episode"]}]}, {"nlike": ["mc.note", {"literal": "%(USA)%"}]}, {"like": ["mc.note", {"literal": "%(200%)%"}]}, {"in": ["mi.info", {"literal": ["Germany", "German", "USA", "American"]}]}, {"lt": ["mi_idx.info", {"literal": "7.0"}]}, {"gt": ["t.production_year", 2008]}, {"eq": ["kt.id", "t.kind_id"]}, {"eq": ["t.id", "mi.movie_id"]}, {"eq": ["t.id", "mk.movie_id"]}, {"eq": ["t.id", "mi_idx.movie_id"]}, {"eq": ["t.id", "mc.movie_id"]}, {"eq": ["mk.movie_id", "mi.movie_id"]}, {"eq": ["mk.movie_id", "mi_idx.movie_id"]}, {"eq": ["mk.movie_id", "mc.movie_id"]}, {"eq": ["mi.movie_id", "mi_idx.movie_id"]}, {"eq": ["mi.movie_id", "mc.movie_id"]}, {"eq": ["mc.movie_id", "mi_idx.movie_id"]}, {"eq": ["k.id", "mk.keyword_id"]}, {"eq": ["it1.id", "mi.info_type_id"]}, {"eq": ["it2.id", "mi_idx.info_type_id"]}, {"eq": ["ct.id", "mc.company_type_id"]}, {"eq": ["cn.id", "mc.company_id"]}]}}', 25.8959999, 688.004028, 7477.16016);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (12, '33b.sql', 14, 'SELECT MIN(cn1.name) AS first_company,
MIN(cn2.name) AS second_company,
MIN(mi_idx1.info) AS first_rating,
MIN(mi_idx2.info) AS second_rating,
MIN(t1.title) AS first_movie,
MIN(t2.title) AS second_movie
FROM company_name AS cn1,
company_name AS cn2,
info_type AS it1,
info_type AS it2,
kind_type AS kt1,
kind_type AS kt2,
link_type AS lt,
movie_companies AS mc1,
movie_companies AS mc2,
movie_info_idx AS mi_idx1,
movie_info_idx AS mi_idx2,
movie_link AS ml,
title AS t1,
title AS t2
WHERE cn1.country_code = ''[nl]''
AND it1.info = ''rating''
AND it2.info = ''rating''
AND kt1.kind IN (''tv series'')
AND kt2.kind IN (''tv series'')
AND lt.link LIKE ''%follow%''
AND mi_idx2.info < ''3.0''
AND t2.production_year = 2007
AND lt.id = ml.link_type_id
AND t1.id = ml.movie_id
AND t2.id = ml.linked_movie_id
AND it1.id = mi_idx1.info_type_id
AND t1.id = mi_idx1.movie_id
AND kt1.id = t1.kind_id
AND cn1.id = mc1.company_id
AND t1.id = mc1.movie_id
AND ml.movie_id = mi_idx1.movie_id
AND ml.movie_id = mc1.movie_id
AND mi_idx1.movie_id = mc1.movie_id
AND it2.id = mi_idx2.info_type_id
AND t2.id = mi_idx2.movie_id
AND kt2.id = t2.kind_id
AND cn2.id = mc2.company_id
AND t2.id = mc2.movie_id
AND ml.linked_movie_id = mi_idx2.movie_id
AND ml.linked_movie_id = mc2.movie_id
AND mi_idx2.movie_id = mc2.movie_id;
', '{"select": [{"value": {"min": "cn1.name"}, "name": "first_company"}, {"value": {"min": "cn2.name"}, "name": "second_company"}, {"value": {"min": "mi_idx1.info"}, "name": "first_rating"}, {"value": {"min": "mi_idx2.info"}, "name": "second_rating"}, {"value": {"min": "t1.title"}, "name": "first_movie"}, {"value": {"min": "t2.title"}, "name": "second_movie"}], "from": [{"value": "company_name", "name": "cn1"}, {"value": "company_name", "name": "cn2"}, {"value": "info_type", "name": "it1"}, {"value": "info_type", "name": "it2"}, {"value": "kind_type", "name": "kt1"}, {"value": "kind_type", "name": "kt2"}, {"value": "link_type", "name": "lt"}, {"value": "movie_companies", "name": "mc1"}, {"value": "movie_companies", "name": "mc2"}, {"value": "movie_info_idx", "name": "mi_idx1"}, {"value": "movie_info_idx", "name": "mi_idx2"}, {"value": "movie_link", "name": "ml"}, {"value": "title", "name": "t1"}, {"value": "title", "name": "t2"}], "where": {"and": [{"eq": ["cn1.country_code", {"literal": "[nl]"}]}, {"eq": ["it1.info", {"literal": "rating"}]}, {"eq": ["it2.info", {"literal": "rating"}]}, {"in": ["kt1.kind", {"literal": "tv series"}]}, {"in": ["kt2.kind", {"literal": "tv series"}]}, {"like": ["lt.link", {"literal": "%follow%"}]}, {"lt": ["mi_idx2.info", {"literal": "3.0"}]}, {"eq": ["t2.production_year", 2007]}, {"eq": ["lt.id", "ml.link_type_id"]}, {"eq": ["t1.id", "ml.movie_id"]}, {"eq": ["t2.id", "ml.linked_movie_id"]}, {"eq": ["it1.id", "mi_idx1.info_type_id"]}, {"eq": ["t1.id", "mi_idx1.movie_id"]}, {"eq": ["kt1.id", "t1.kind_id"]}, {"eq": ["cn1.id", "mc1.company_id"]}, {"eq": ["t1.id", "mc1.movie_id"]}, {"eq": ["ml.movie_id", "mi_idx1.movie_id"]}, {"eq": ["ml.movie_id", "mc1.movie_id"]}, {"eq": ["mi_idx1.movie_id", "mc1.movie_id"]}, {"eq": ["it2.id", "mi_idx2.info_type_id"]}, {"eq": ["t2.id", "mi_idx2.movie_id"]}, {"eq": ["kt2.id", "t2.kind_id"]}, {"eq": ["cn2.id", "mc2.company_id"]}, {"eq": ["t2.id", "mc2.movie_id"]}, {"eq": ["ml.linked_movie_id", "mi_idx2.movie_id"]}, {"eq": ["ml.linked_movie_id", "mc2.movie_id"]}, {"eq": ["mi_idx2.movie_id", "mc2.movie_id"]}]}}', 61.2130013, 41.8899994, 386.950012);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (13, '8d.sql', 7, 'SELECT MIN(an1.name) AS costume_designer_pseudo,
MIN(t.title) AS movie_with_costumes
FROM aka_name AS an1,
cast_info AS ci,
company_name AS cn,
movie_companies AS mc,
name AS n1,
role_type AS rt,
title AS t
WHERE cn.country_code =''[us]''
AND rt.role =''costume designer''
AND an1.person_id = n1.id
AND n1.id = ci.person_id
AND ci.movie_id = t.id
AND t.id = mc.movie_id
AND mc.company_id = cn.id
AND ci.role_id = rt.id
AND an1.person_id = ci.person_id
AND ci.movie_id = mc.movie_id;
', '{"select": [{"value": {"min": "an1.name"}, "name": "costume_designer_pseudo"}, {"value": {"min": "t.title"}, "name": "movie_with_costumes"}], "from": [{"value": "aka_name", "name": "an1"}, {"value": "cast_info", "name": "ci"}, {"value": "company_name", "name": "cn"}, {"value": "movie_companies", "name": "mc"}, {"value": "name", "name": "n1"}, {"value": "role_type", "name": "rt"}, {"value": "title", "name": "t"}], "where": {"and": [{"eq": ["cn.country_code", {"literal": "[us]"}]}, {"eq": ["rt.role", {"literal": "costume designer"}]}, {"eq": ["an1.person_id", "n1.id"]}, {"eq": ["n1.id", "ci.person_id"]}, {"eq": ["ci.movie_id", "t.id"]}, {"eq": ["t.id", "mc.movie_id"]}, {"eq": ["mc.company_id", "cn.id"]}, {"eq": ["ci.role_id", "rt.id"]}, {"eq": ["an1.person_id", "ci.person_id"]}, {"eq": ["ci.movie_id", "mc.movie_id"]}]}}', 2.20499992, 4856.16016, 620935.75);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (14, '20a.sql', 10, 'SELECT MIN(t.title) AS complete_downey_ironman_movie
FROM complete_cast AS cc,
comp_cast_type AS cct1,
comp_cast_type AS cct2,
char_name AS chn,
cast_info AS ci,
keyword AS k,
kind_type AS kt,
movie_keyword AS mk,
name AS n,
title AS t
WHERE cct1.kind = ''cast''
AND cct2.kind LIKE ''%complete%''
AND chn.name NOT LIKE ''%Sherlock%''
AND (chn.name LIKE ''%Tony%Stark%''
OR chn.name LIKE ''%Iron%Man%'')
AND k.keyword IN (''superhero'',
''sequel'',
''second-part'',
''marvel-comics'',
''based-on-comic'',
''tv-special'',
''fight'',
''violence'')
AND kt.kind = ''movie''
AND t.production_year > 1950
AND kt.id = t.kind_id
AND t.id = mk.movie_id
AND t.id = ci.movie_id
AND t.id = cc.movie_id
AND mk.movie_id = ci.movie_id
AND mk.movie_id = cc.movie_id
AND ci.movie_id = cc.movie_id
AND chn.id = ci.person_role_id
AND n.id = ci.person_id
AND k.id = mk.keyword_id
AND cct1.id = cc.subject_id
AND cct2.id = cc.status_id;
', '{"select": {"value": {"min": "t.title"}, "name": "complete_downey_ironman_movie"}, "from": [{"value": "complete_cast", "name": "cc"}, {"value": "comp_cast_type", "name": "cct1"}, {"value": "comp_cast_type", "name": "cct2"}, {"value": "char_name", "name": "chn"}, {"value": "cast_info", "name": "ci"}, {"value": "keyword", "name": "k"}, {"value": "kind_type", "name": "kt"}, {"value": "movie_keyword", "name": "mk"}, {"value": "name", "name": "n"}, {"value": "title", "name": "t"}], "where": {"and": [{"eq": ["cct1.kind", {"literal": "cast"}]}, {"like": ["cct2.kind", {"literal": "%complete%"}]}, {"nlike": ["chn.name", {"literal": "%Sherlock%"}]}, {"or": [{"like": ["chn.name", {"literal": "%Tony%Stark%"}]}, {"like": ["chn.name", {"literal": "%Iron%Man%"}]}]}, {"in": ["k.keyword", {"literal": ["superhero", "sequel", "second-part", "marvel-comics", "based-on-comic", "tv-special", "fight", "violence"]}]}, {"eq": ["kt.kind", {"literal": "movie"}]}, {"gt": ["t.production_year", 1950]}, {"eq": ["kt.id", "t.kind_id"]}, {"eq": ["t.id", "mk.movie_id"]}, {"eq": ["t.id", "ci.movie_id"]}, {"eq": ["t.id", "cc.movie_id"]}, {"eq": ["mk.movie_id", "ci.movie_id"]}, {"eq": ["mk.movie_id", "cc.movie_id"]}, {"eq": ["ci.movie_id", "cc.movie_id"]}, {"eq": ["chn.id", "ci.person_role_id"]}, {"eq": ["n.id", "ci.person_id"]}, {"eq": ["k.id", "mk.keyword_id"]}, {"eq": ["cct1.id", "cc.subject_id"]}, {"eq": ["cct2.id", "cc.status_id"]}]}}', 10.177, 127939.75, 2496.69995);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (16, '13c.sql', 9, 'SELECT MIN(cn.name) AS producing_company,
MIN(miidx.info) AS rating,
MIN(t.title) AS movie_about_winning
FROM company_name AS cn,
company_type AS ct,
info_type AS it,
info_type AS it2,
kind_type AS kt,
movie_companies AS mc,
movie_info AS mi,
movie_info_idx AS miidx,
title AS t
WHERE cn.country_code =''[us]''
AND ct.kind =''production companies''
AND it.info =''rating''
AND it2.info =''release dates''
AND kt.kind =''movie''
AND t.title != ''''
AND (t.title LIKE ''Champion%''
OR t.title LIKE ''Loser%'')
AND mi.movie_id = t.id
AND it2.id = mi.info_type_id
AND kt.id = t.kind_id
AND mc.movie_id = t.id
AND cn.id = mc.company_id
AND ct.id = mc.company_type_id
AND miidx.movie_id = t.id
AND it.id = miidx.info_type_id
AND mi.movie_id = miidx.movie_id
AND mi.movie_id = mc.movie_id
AND miidx.movie_id = mc.movie_id;
', '{"select": [{"value": {"min": "cn.name"}, "name": "producing_company"}, {"value": {"min": "miidx.info"}, "name": "rating"}, {"value": {"min": "t.title"}, "name": "movie_about_winning"}], "from": [{"value": "company_name", "name": "cn"}, {"value": "company_type", "name": "ct"}, {"value": "info_type", "name": "it"}, {"value": "info_type", "name": "it2"}, {"value": "kind_type", "name": "kt"}, {"value": "movie_companies", "name": "mc"}, {"value": "movie_info", "name": "mi"}, {"value": "movie_info_idx", "name": "miidx"}, {"value": "title", "name": "t"}], "where": {"and": [{"eq": ["cn.country_code", {"literal": "[us]"}]}, {"eq": ["ct.kind", {"literal": "production companies"}]}, {"eq": ["it.info", {"literal": "rating"}]}, {"eq": ["it2.info", {"literal": "release dates"}]}, {"eq": ["kt.kind", {"literal": "movie"}]}, {"neq": ["t.title", {"literal": ""}]}, {"or": [{"like": ["t.title", {"literal": "Champion%"}]}, {"like": ["t.title", {"literal": "Loser%"}]}]}, {"eq": ["mi.movie_id", "t.id"]}, {"eq": ["it2.id", "mi.info_type_id"]}, {"eq": ["kt.id", "t.kind_id"]}, {"eq": ["mc.movie_id", "t.id"]}, {"eq": ["cn.id", "mc.company_id"]}, {"eq": ["ct.id", "mc.company_type_id"]}, {"eq": ["miidx.movie_id", "t.id"]}, {"eq": ["it.id", "miidx.info_type_id"]}, {"eq": ["mi.movie_id", "miidx.movie_id"]}, {"eq": ["mi.movie_id", "mc.movie_id"]}, {"eq": ["miidx.movie_id", "mc.movie_id"]}]}}', 5.25400019, 466.5, 19236.6992);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (17, '6d.sql', 5, 'SELECT MIN(k.keyword) AS movie_keyword,
MIN(n.name) AS actor_name,
MIN(t.title) AS hero_movie
FROM cast_info AS ci,
keyword AS k,
movie_keyword AS mk,
name AS n,
title AS t
WHERE k.keyword IN (''superhero'',
''sequel'',
''second-part'',
''marvel-comics'',
''based-on-comic'',
''tv-special'',
''fight'',
''violence'')
AND n.name LIKE ''%Downey%Robert%''
AND t.production_year > 2000
AND k.id = mk.keyword_id
AND t.id = mk.movie_id
AND t.id = ci.movie_id
AND ci.movie_id = mk.movie_id
AND n.id = ci.person_id;
', '{"select": [{"value": {"min": "k.keyword"}, "name": "movie_keyword"}, {"value": {"min": "n.name"}, "name": "actor_name"}, {"value": {"min": "t.title"}, "name": "hero_movie"}], "from": [{"value": "cast_info", "name": "ci"}, {"value": "keyword", "name": "k"}, {"value": "movie_keyword", "name": "mk"}, {"value": "name", "name": "n"}, {"value": "title", "name": "t"}], "where": {"and": [{"in": ["k.keyword", {"literal": ["superhero", "sequel", "second-part", "marvel-comics", "based-on-comic", "tv-special", "fight", "violence"]}]}, {"like": ["n.name", {"literal": "%Downey%Robert%"}]}, {"gt": ["t.production_year", 2000]}, {"eq": ["k.id", "mk.keyword_id"]}, {"eq": ["t.id", "mk.movie_id"]}, {"eq": ["t.id", "ci.movie_id"]}, {"eq": ["ci.movie_id", "mk.movie_id"]}, {"eq": ["n.id", "ci.person_id"]}]}}', 0.992999971, 6842.53076, 15184.8701);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (18, '2b.sql', 5, 'SELECT MIN(t.title) AS movie_title
FROM company_name AS cn,
keyword AS k,
movie_companies AS mc,
movie_keyword AS mk,
title AS t
WHERE cn.country_code =''[nl]''
AND k.keyword =''character-name-in-title''
AND cn.id = mc.company_id
AND mc.movie_id = t.id
AND t.id = mk.movie_id
AND mk.keyword_id = k.id
AND mc.movie_id = mk.movie_id;
', '{"select": {"value": {"min": "t.title"}, "name": "movie_title"}, "from": [{"value": "company_name", "name": "cn"}, {"value": "keyword", "name": "k"}, {"value": "movie_companies", "name": "mc"}, {"value": "movie_keyword", "name": "mk"}, {"value": "title", "name": "t"}], "where": {"and": [{"eq": ["cn.country_code", {"literal": "[nl]"}]}, {"eq": ["k.keyword", {"literal": "character-name-in-title"}]}, {"eq": ["cn.id", "mc.company_id"]}, {"eq": ["mc.movie_id", "t.id"]}, {"eq": ["t.id", "mk.movie_id"]}, {"eq": ["mk.keyword_id", "k.id"]}, {"eq": ["mc.movie_id", "mk.movie_id"]}]}}', 0.855000019, 556.06897, 3846.29004);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (19, '3a.sql', 4, 'SELECT MIN(t.title) AS movie_title
FROM keyword AS k,
movie_info AS mi,
movie_keyword AS mk,
title AS t
WHERE k.keyword LIKE ''%sequel%''
AND mi.info IN (''Sweden'',
''Norway'',
''Germany'',
''Denmark'',
''Swedish'',
''Denish'',
''Norwegian'',
''German'')
AND t.production_year > 2005
AND t.id = mi.movie_id
AND t.id = mk.movie_id
AND mk.movie_id = mi.movie_id
AND k.id = mk.keyword_id;
', '{"select": {"value": {"min": "t.title"}, "name": "movie_title"}, "from": [{"value": "keyword", "name": "k"}, {"value": "movie_info", "name": "mi"}, {"value": "movie_keyword", "name": "mk"}, {"value": "title", "name": "t"}], "where": {"and": [{"like": ["k.keyword", {"literal": "%sequel%"}]}, {"in": ["mi.info", {"literal": ["Sweden", "Norway", "Germany", "Denmark", "Swedish", "Denish", "Norwegian", "German"]}]}, {"gt": ["t.production_year", 2005]}, {"eq": ["t.id", "mi.movie_id"]}, {"eq": ["t.id", "mk.movie_id"]}, {"eq": ["mk.movie_id", "mi.movie_id"]}, {"eq": ["k.id", "mk.keyword_id"]}]}}', 0.745000005, 204.335999, 16738.0391);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (22, '2c.sql', 5, 'SELECT MIN(t.title) AS movie_title
FROM company_name AS cn,
keyword AS k,
movie_companies AS mc,
movie_keyword AS mk,
title AS t
WHERE cn.country_code =''[sm]''
AND k.keyword =''character-name-in-title''
AND cn.id = mc.company_id
AND mc.movie_id = t.id
AND t.id = mk.movie_id
AND mk.keyword_id = k.id
AND mc.movie_id = mk.movie_id;
', '{"select": {"value": {"min": "t.title"}, "name": "movie_title"}, "from": [{"value": "company_name", "name": "cn"}, {"value": "keyword", "name": "k"}, {"value": "movie_companies", "name": "mc"}, {"value": "movie_keyword", "name": "mk"}, {"value": "title", "name": "t"}], "where": {"and": [{"eq": ["cn.country_code", {"literal": "[sm]"}]}, {"eq": ["k.keyword", {"literal": "character-name-in-title"}]}, {"eq": ["cn.id", "mc.company_id"]}, {"eq": ["mc.movie_id", "t.id"]}, {"eq": ["t.id", "mk.movie_id"]}, {"eq": ["mk.keyword_id", "k.id"]}, {"eq": ["mc.movie_id", "mk.movie_id"]}]}}', 0.769999981, 443.34201, 3845.78003);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (23, '2a.sql', 5, 'SELECT MIN(t.title) AS movie_title
FROM company_name AS cn,
keyword AS k,
movie_companies AS mc,
movie_keyword AS mk,
title AS t
WHERE cn.country_code =''[de]''
AND k.keyword =''character-name-in-title''
AND cn.id = mc.company_id
AND mc.movie_id = t.id
AND t.id = mk.movie_id
AND mk.keyword_id = k.id
AND mc.movie_id = mk.movie_id;
', '{"select": {"value": {"min": "t.title"}, "name": "movie_title"}, "from": [{"value": "company_name", "name": "cn"}, {"value": "keyword", "name": "k"}, {"value": "movie_companies", "name": "mc"}, {"value": "movie_keyword", "name": "mk"}, {"value": "title", "name": "t"}], "where": {"and": [{"eq": ["cn.country_code", {"literal": "[de]"}]}, {"eq": ["k.keyword", {"literal": "character-name-in-title"}]}, {"eq": ["cn.id", "mc.company_id"]}, {"eq": ["mc.movie_id", "t.id"]}, {"eq": ["t.id", "mk.movie_id"]}, {"eq": ["mk.keyword_id", "k.id"]}, {"eq": ["mc.movie_id", "mk.movie_id"]}]}}', 0.736000001, 487.746002, 3848.80005);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (25, '6a.sql', 5, 'SELECT MIN(k.keyword) AS movie_keyword,
MIN(n.name) AS actor_name,
MIN(t.title) AS marvel_movie
FROM cast_info AS ci,
keyword AS k,
movie_keyword AS mk,
name AS n,
title AS t
WHERE k.keyword = ''marvel-cinematic-universe''
AND n.name LIKE ''%Downey%Robert%''
AND t.production_year > 2010
AND k.id = mk.keyword_id
AND t.id = mk.movie_id
AND t.id = ci.movie_id
AND ci.movie_id = mk.movie_id
AND n.id = ci.person_id;
', '{"select": [{"value": {"min": "k.keyword"}, "name": "movie_keyword"}, {"value": {"min": "n.name"}, "name": "actor_name"}, {"value": {"min": "t.title"}, "name": "marvel_movie"}], "from": [{"value": "cast_info", "name": "ci"}, {"value": "keyword", "name": "k"}, {"value": "movie_keyword", "name": "mk"}, {"value": "name", "name": "n"}, {"value": "title", "name": "t"}], "where": {"and": [{"eq": ["k.keyword", {"literal": "marvel-cinematic-universe"}]}, {"like": ["n.name", {"literal": "%Downey%Robert%"}]}, {"gt": ["t.production_year", 2010]}, {"eq": ["k.id", "mk.keyword_id"]}, {"eq": ["t.id", "mk.movie_id"]}, {"eq": ["t.id", "ci.movie_id"]}, {"eq": ["ci.movie_id", "mk.movie_id"]}, {"eq": ["n.id", "ci.person_id"]}]}}', 0.889999986, 21.5319996, 3860.13989);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (26, '16c.sql', 8, 'SELECT MIN(an.name) AS cool_actor_pseudonym,
MIN(t.title) AS series_named_after_char
FROM aka_name AS an,
cast_info AS ci,
company_name AS cn,
keyword AS k,
movie_companies AS mc,
movie_keyword AS mk,
name AS n,
title AS t
WHERE cn.country_code =''[us]''
AND k.keyword =''character-name-in-title''
AND t.episode_nr < 100
AND an.person_id = n.id
AND n.id = ci.person_id
AND ci.movie_id = t.id
AND t.id = mk.movie_id
AND mk.keyword_id = k.id
AND t.id = mc.movie_id
AND mc.company_id = cn.id
AND an.person_id = ci.person_id
AND ci.movie_id = mc.movie_id
AND ci.movie_id = mk.movie_id
AND mc.movie_id = mk.movie_id;
', '{"select": [{"value": {"min": "an.name"}, "name": "cool_actor_pseudonym"}, {"value": {"min": "t.title"}, "name": "series_named_after_char"}], "from": [{"value": "aka_name", "name": "an"}, {"value": "cast_info", "name": "ci"}, {"value": "company_name", "name": "cn"}, {"value": "keyword", "name": "k"}, {"value": "movie_companies", "name": "mc"}, {"value": "movie_keyword", "name": "mk"}, {"value": "name", "name": "n"}, {"value": "title", "name": "t"}], "where": {"and": [{"eq": ["cn.country_code", {"literal": "[us]"}]}, {"eq": ["k.keyword", {"literal": "character-name-in-title"}]}, {"lt": ["t.episode_nr", 100]}, {"eq": ["an.person_id", "n.id"]}, {"eq": ["n.id", "ci.person_id"]}, {"eq": ["ci.movie_id", "t.id"]}, {"eq": ["t.id", "mk.movie_id"]}, {"eq": ["mk.keyword_id", "k.id"]}, {"eq": ["t.id", "mc.movie_id"]}, {"eq": ["mc.company_id", "cn.id"]}, {"eq": ["an.person_id", "ci.person_id"]}, {"eq": ["ci.movie_id", "mc.movie_id"]}, {"eq": ["ci.movie_id", "mk.movie_id"]}, {"eq": ["mc.movie_id", "mk.movie_id"]}]}}', 4.54799986, 2273.25293, 4346.10986);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (27, '5b.sql', 5, 'SELECT MIN(t.title) AS american_vhs_movie
FROM company_type AS ct,
info_type AS it,
movie_companies AS mc,
movie_info AS mi,
title AS t
WHERE ct.kind = ''production companies''
AND mc.note LIKE ''%(VHS)%''
AND mc.note LIKE ''%(USA)%''
AND mc.note LIKE ''%(1994)%''
AND mi.info IN (''USA'',
''America'')
AND t.production_year > 2010
AND t.id = mi.movie_id
AND t.id = mc.movie_id
AND mc.movie_id = mi.movie_id
AND ct.id = mc.company_type_id
AND it.id = mi.info_type_id;
', '{"select": {"value": {"min": "t.title"}, "name": "american_vhs_movie"}, "from": [{"value": "company_type", "name": "ct"}, {"value": "info_type", "name": "it"}, {"value": "movie_companies", "name": "mc"}, {"value": "movie_info", "name": "mi"}, {"value": "title", "name": "t"}], "where": {"and": [{"eq": ["ct.kind", {"literal": "production companies"}]}, {"like": ["mc.note", {"literal": "%(VHS)%"}]}, {"like": ["mc.note", {"literal": "%(USA)%"}]}, {"like": ["mc.note", {"literal": "%(1994)%"}]}, {"in": ["mi.info", {"literal": ["USA", "America"]}]}, {"gt": ["t.production_year", 2010]}, {"eq": ["t.id", "mi.movie_id"]}, {"eq": ["t.id", "mc.movie_id"]}, {"eq": ["mc.movie_id", "mi.movie_id"]}, {"eq": ["ct.id", "mc.company_type_id"]}, {"eq": ["it.id", "mi.info_type_id"]}]}}', 0.917999983, 140.128006, 38846.2812);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (28, '1a.sql', 5, 'SELECT MIN(mc.note) AS production_note,
MIN(t.title) AS movie_title,
MIN(t.production_year) AS movie_year
FROM company_type AS ct,
info_type AS it,
movie_companies AS mc,
movie_info_idx AS mi_idx,
title AS t
WHERE ct.kind = ''production companies''
AND it.info = ''top 250 rank''
AND mc.note NOT LIKE ''%(as Metro-Goldwyn-Mayer Pictures)%''
AND (mc.note LIKE ''%(co-production)%''
OR mc.note LIKE ''%(presents)%'')
AND ct.id = mc.company_type_id
AND t.id = mc.movie_id
AND t.id = mi_idx.movie_id
AND mc.movie_id = mi_idx.movie_id
AND it.id = mi_idx.info_type_id;
', '{"select": [{"value": {"min": "mc.note"}, "name": "production_note"}, {"value": {"min": "t.title"}, "name": "movie_title"}, {"value": {"min": "t.production_year"}, "name": "movie_year"}], "from": [{"value": "company_type", "name": "ct"}, {"value": "info_type", "name": "it"}, {"value": "movie_companies", "name": "mc"}, {"value": "movie_info_idx", "name": "mi_idx"}, {"value": "title", "name": "t"}], "where": {"and": [{"eq": ["ct.kind", {"literal": "production companies"}]}, {"eq": ["it.info", {"literal": "top 250 rank"}]}, {"nlike": ["mc.note", {"literal": "%(as Metro-Goldwyn-Mayer Pictures)%"}]}, {"or": [{"like": ["mc.note", {"literal": "%(co-production)%"}]}, {"like": ["mc.note", {"literal": "%(presents)%"}]}]}, {"eq": ["ct.id", "mc.company_type_id"]}, {"eq": ["t.id", "mc.movie_id"]}, {"eq": ["t.id", "mi_idx.movie_id"]}, {"eq": ["mc.movie_id", "mi_idx.movie_id"]}, {"eq": ["it.id", "mi_idx.info_type_id"]}]}}', 0.898000002, 76.0319977, 19564.1191);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (29, '33c.sql', 14, 'SELECT MIN(cn1.name) AS first_company,
MIN(cn2.name) AS second_company,
MIN(mi_idx1.info) AS first_rating,
MIN(mi_idx2.info) AS second_rating,
MIN(t1.title) AS first_movie,
MIN(t2.title) AS second_movie
FROM company_name AS cn1,
company_name AS cn2,
info_type AS it1,
info_type AS it2,
kind_type AS kt1,
kind_type AS kt2,
link_type AS lt,
movie_companies AS mc1,
movie_companies AS mc2,
movie_info_idx AS mi_idx1,
movie_info_idx AS mi_idx2,
movie_link AS ml,
title AS t1,
title AS t2
WHERE cn1.country_code != ''[us]''
AND it1.info = ''rating''
AND it2.info = ''rating''
AND kt1.kind IN (''tv series'',
''episode'')
AND kt2.kind IN (''tv series'',
''episode'')
AND lt.link IN (''sequel'',
''follows'',
''followed by'')
AND mi_idx2.info < ''3.5''
AND t2.production_year BETWEEN 2000 AND 2010
AND lt.id = ml.link_type_id
AND t1.id = ml.movie_id
AND t2.id = ml.linked_movie_id
AND it1.id = mi_idx1.info_type_id
AND t1.id = mi_idx1.movie_id
AND kt1.id = t1.kind_id
AND cn1.id = mc1.company_id
AND t1.id = mc1.movie_id
AND ml.movie_id = mi_idx1.movie_id
AND ml.movie_id = mc1.movie_id
AND mi_idx1.movie_id = mc1.movie_id
AND it2.id = mi_idx2.info_type_id
AND t2.id = mi_idx2.movie_id
AND kt2.id = t2.kind_id
AND cn2.id = mc2.company_id
AND t2.id = mc2.movie_id
AND ml.linked_movie_id = mi_idx2.movie_id
AND ml.linked_movie_id = mc2.movie_id
AND mi_idx2.movie_id = mc2.movie_id;
', '{"select": [{"value": {"min": "cn1.name"}, "name": "first_company"}, {"value": {"min": "cn2.name"}, "name": "second_company"}, {"value": {"min": "mi_idx1.info"}, "name": "first_rating"}, {"value": {"min": "mi_idx2.info"}, "name": "second_rating"}, {"value": {"min": "t1.title"}, "name": "first_movie"}, {"value": {"min": "t2.title"}, "name": "second_movie"}], "from": [{"value": "company_name", "name": "cn1"}, {"value": "company_name", "name": "cn2"}, {"value": "info_type", "name": "it1"}, {"value": "info_type", "name": "it2"}, {"value": "kind_type", "name": "kt1"}, {"value": "kind_type", "name": "kt2"}, {"value": "link_type", "name": "lt"}, {"value": "movie_companies", "name": "mc1"}, {"value": "movie_companies", "name": "mc2"}, {"value": "movie_info_idx", "name": "mi_idx1"}, {"value": "movie_info_idx", "name": "mi_idx2"}, {"value": "movie_link", "name": "ml"}, {"value": "title", "name": "t1"}, {"value": "title", "name": "t2"}], "where": {"and": [{"neq": ["cn1.country_code", {"literal": "[us]"}]}, {"eq": ["it1.info", {"literal": "rating"}]}, {"eq": ["it2.info", {"literal": "rating"}]}, {"in": ["kt1.kind", {"literal": ["tv series", "episode"]}]}, {"in": ["kt2.kind", {"literal": ["tv series", "episode"]}]}, {"in": ["lt.link", {"literal": ["sequel", "follows", "followed by"]}]}, {"lt": ["mi_idx2.info", {"literal": "3.5"}]}, {"between": ["t2.production_year", 2000, 2010]}, {"eq": ["lt.id", "ml.link_type_id"]}, {"eq": ["t1.id", "ml.movie_id"]}, {"eq": ["t2.id", "ml.linked_movie_id"]}, {"eq": ["it1.id", "mi_idx1.info_type_id"]}, {"eq": ["t1.id", "mi_idx1.movie_id"]}, {"eq": ["kt1.id", "t1.kind_id"]}, {"eq": ["cn1.id", "mc1.company_id"]}, {"eq": ["t1.id", "mc1.movie_id"]}, {"eq": ["ml.movie_id", "mi_idx1.movie_id"]}, {"eq": ["ml.movie_id", "mc1.movie_id"]}, {"eq": ["mi_idx1.movie_id", "mc1.movie_id"]}, {"eq": ["it2.id", "mi_idx2.info_type_id"]}, {"eq": ["t2.id", "mi_idx2.movie_id"]}, {"eq": ["kt2.id", "t2.kind_id"]}, {"eq": ["cn2.id", "mc2.company_id"]}, {"eq": ["t2.id", "mc2.movie_id"]}, {"eq": ["ml.linked_movie_id", "mi_idx2.movie_id"]}, {"eq": ["ml.linked_movie_id", "mc2.movie_id"]}, {"eq": ["mi_idx2.movie_id", "mc2.movie_id"]}]}}', 60.4939995, 268.209991, 1890.31006);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (30, '5a.sql', 5, 'SELECT MIN(t.title) AS typical_european_movie
FROM company_type AS ct,
info_type AS it,
movie_companies AS mc,
movie_info AS mi,
title AS t
WHERE ct.kind = ''production companies''
AND mc.note LIKE ''%(theatrical)%''
AND mc.note LIKE ''%(France)%''
AND mi.info IN (''Sweden'',
''Norway'',
''Germany'',
''Denmark'',
''Swedish'',
''Denish'',
''Norwegian'',
''German'')
AND t.production_year > 2005
AND t.id = mi.movie_id
AND t.id = mc.movie_id
AND mc.movie_id = mi.movie_id
AND ct.id = mc.company_type_id
AND it.id = mi.info_type_id;
', '{"select": {"value": {"min": "t.title"}, "name": "typical_european_movie"}, "from": [{"value": "company_type", "name": "ct"}, {"value": "info_type", "name": "it"}, {"value": "movie_companies", "name": "mc"}, {"value": "movie_info", "name": "mi"}, {"value": "title", "name": "t"}], "where": {"and": [{"eq": ["ct.kind", {"literal": "production companies"}]}, {"like": ["mc.note", {"literal": "%(theatrical)%"}]}, {"like": ["mc.note", {"literal": "%(France)%"}]}, {"in": ["mi.info", {"literal": ["Sweden", "Norway", "Germany", "Denmark", "Swedish", "Denish", "Norwegian", "German"]}]}, {"gt": ["t.production_year", 2005]}, {"eq": ["t.id", "mi.movie_id"]}, {"eq": ["t.id", "mc.movie_id"]}, {"eq": ["mc.movie_id", "mi.movie_id"]}, {"eq": ["ct.id", "mc.company_type_id"]}, {"eq": ["it.id", "mi.info_type_id"]}]}}', 0.833000004, 107.974998, 36260.1602);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (31, '32b.sql', 6, 'SELECT MIN(lt.link) AS link_type,
MIN(t1.title) AS first_movie,
MIN(t2.title) AS second_movie
FROM keyword AS k,
link_type AS lt,
movie_keyword AS mk,
movie_link AS ml,
title AS t1,
title AS t2
WHERE k.keyword =''character-name-in-title''
AND mk.keyword_id = k.id
AND t1.id = mk.movie_id
AND ml.movie_id = t1.id
AND ml.linked_movie_id = t2.id
AND lt.id = ml.link_type_id
AND mk.movie_id = t1.id;
', '{"select": [{"value": {"min": "lt.link"}, "name": "link_type"}, {"value": {"min": "t1.title"}, "name": "first_movie"}, {"value": {"min": "t2.title"}, "name": "second_movie"}], "from": [{"value": "keyword", "name": "k"}, {"value": "link_type", "name": "lt"}, {"value": "movie_keyword", "name": "mk"}, {"value": "movie_link", "name": "ml"}, {"value": "title", "name": "t1"}, {"value": "title", "name": "t2"}], "where": {"and": [{"eq": ["k.keyword", {"literal": "character-name-in-title"}]}, {"eq": ["mk.keyword_id", "k.id"]}, {"eq": ["t1.id", "mk.movie_id"]}, {"eq": ["ml.movie_id", "t1.id"]}, {"eq": ["ml.linked_movie_id", "t2.id"]}, {"eq": ["lt.id", "ml.link_type_id"]}, {"eq": ["mk.movie_id", "t1.id"]}]}}', 1.01900005, 128.893997, 3809.79004);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (33, '31b.sql', 11, 'SELECT MIN(mi.info) AS movie_budget,
MIN(mi_idx.info) AS movie_votes,
MIN(n.name) AS writer,
MIN(t.title) AS violent_liongate_movie
FROM cast_info AS ci,
company_name AS cn,
info_type AS it1,
info_type AS it2,
keyword AS k,
movie_companies AS mc,
movie_info AS mi,
movie_info_idx AS mi_idx,
movie_keyword AS mk,
name AS n,
title AS t
WHERE ci.note IN (''(writer)'',
''(head writer)'',
''(written by)'',
''(story)'',
''(story editor)'')
AND cn.name LIKE ''Lionsgate%''
AND it1.info = ''genres''
AND it2.info = ''votes''
AND k.keyword IN (''murder'',
''violence'',
''blood'',
''gore'',
''death'',
''female-nudity'',
''hospital'')
AND mc.note LIKE ''%(Blu-ray)%''
AND mi.info IN (''Horror'',
''Thriller'')
AND n.gender = ''m''
AND t.production_year > 2000
AND (t.title LIKE ''%Freddy%''
OR t.title LIKE ''%Jason%''
OR t.title LIKE ''Saw%'')
AND t.id = mi.movie_id
AND t.id = mi_idx.movie_id
AND t.id = ci.movie_id
AND t.id = mk.movie_id
AND t.id = mc.movie_id
AND ci.movie_id = mi.movie_id
AND ci.movie_id = mi_idx.movie_id
AND ci.movie_id = mk.movie_id
AND ci.movie_id = mc.movie_id
AND mi.movie_id = mi_idx.movie_id
AND mi.movie_id = mk.movie_id
AND mi.movie_id = mc.movie_id
AND mi_idx.movie_id = mk.movie_id
AND mi_idx.movie_id = mc.movie_id
AND mk.movie_id = mc.movie_id
AND n.id = ci.person_id
AND it1.id = mi.info_type_id
AND it2.id = mi_idx.info_type_id
AND k.id = mk.keyword_id
AND cn.id = mc.company_id;
', '{"select": [{"value": {"min": "mi.info"}, "name": "movie_budget"}, {"value": {"min": "mi_idx.info"}, "name": "movie_votes"}, {"value": {"min": "n.name"}, "name": "writer"}, {"value": {"min": "t.title"}, "name": "violent_liongate_movie"}], "from": [{"value": "cast_info", "name": "ci"}, {"value": "company_name", "name": "cn"}, {"value": "info_type", "name": "it1"}, {"value": "info_type", "name": "it2"}, {"value": "keyword", "name": "k"}, {"value": "movie_companies", "name": "mc"}, {"value": "movie_info", "name": "mi"}, {"value": "movie_info_idx", "name": "mi_idx"}, {"value": "movie_keyword", "name": "mk"}, {"value": "name", "name": "n"}, {"value": "title", "name": "t"}], "where": {"and": [{"in": ["ci.note", {"literal": ["(writer)", "(head writer)", "(written by)", "(story)", "(story editor)"]}]}, {"like": ["cn.name", {"literal": "Lionsgate%"}]}, {"eq": ["it1.info", {"literal": "genres"}]}, {"eq": ["it2.info", {"literal": "votes"}]}, {"in": ["k.keyword", {"literal": ["murder", "violence", "blood", "gore", "death", "female-nudity", "hospital"]}]}, {"like": ["mc.note", {"literal": "%(Blu-ray)%"}]}, {"in": ["mi.info", {"literal": ["Horror", "Thriller"]}]}, {"eq": ["n.gender", {"literal": "m"}]}, {"gt": ["t.production_year", 2000]}, {"or": [{"like": ["t.title", {"literal": "%Freddy%"}]}, {"like": ["t.title", {"literal": "%Jason%"}]}, {"like": ["t.title", {"literal": "Saw%"}]}]}, {"eq": ["t.id", "mi.movie_id"]}, {"eq": ["t.id", "mi_idx.movie_id"]}, {"eq": ["t.id", "ci.movie_id"]}, {"eq": ["t.id", "mk.movie_id"]}, {"eq": ["t.id", "mc.movie_id"]}, {"eq": ["ci.movie_id", "mi.movie_id"]}, {"eq": ["ci.movie_id", "mi_idx.movie_id"]}, {"eq": ["ci.movie_id", "mk.movie_id"]}, {"eq": ["ci.movie_id", "mc.movie_id"]}, {"eq": ["mi.movie_id", "mi_idx.movie_id"]}, {"eq": ["mi.movie_id", "mk.movie_id"]}, {"eq": ["mi.movie_id", "mc.movie_id"]}, {"eq": ["mi_idx.movie_id", "mk.movie_id"]}, {"eq": ["mi_idx.movie_id", "mc.movie_id"]}, {"eq": ["mk.movie_id", "mc.movie_id"]}, {"eq": ["n.id", "ci.person_id"]}, {"eq": ["it1.id", "mi.info_type_id"]}, {"eq": ["it2.id", "mi_idx.info_type_id"]}, {"eq": ["k.id", "mk.keyword_id"]}, {"eq": ["cn.id", "mc.company_id"]}]}}', 36.7459984, 299.778992, 9465.79004);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (35, '20b.sql', 10, 'SELECT MIN(t.title) AS complete_downey_ironman_movie
FROM complete_cast AS cc,
comp_cast_type AS cct1,
comp_cast_type AS cct2,
char_name AS chn,
cast_info AS ci,
keyword AS k,
kind_type AS kt,
movie_keyword AS mk,
name AS n,
title AS t
WHERE cct1.kind = ''cast''
AND cct2.kind LIKE ''%complete%''
AND chn.name NOT LIKE ''%Sherlock%''
AND (chn.name LIKE ''%Tony%Stark%''
OR chn.name LIKE ''%Iron%Man%'')
AND k.keyword IN (''superhero'',
''sequel'',
''second-part'',
''marvel-comics'',
''based-on-comic'',
''tv-special'',
''fight'',
''violence'')
AND kt.kind = ''movie''
AND n.name LIKE ''%Downey%Robert%''
AND t.production_year > 2000
AND kt.id = t.kind_id
AND t.id = mk.movie_id
AND t.id = ci.movie_id
AND t.id = cc.movie_id
AND mk.movie_id = ci.movie_id
AND mk.movie_id = cc.movie_id
AND ci.movie_id = cc.movie_id
AND chn.id = ci.person_role_id
AND n.id = ci.person_id
AND k.id = mk.keyword_id
AND cct1.id = cc.subject_id
AND cct2.id = cc.status_id;
', '{"select": {"value": {"min": "t.title"}, "name": "complete_downey_ironman_movie"}, "from": [{"value": "complete_cast", "name": "cc"}, {"value": "comp_cast_type", "name": "cct1"}, {"value": "comp_cast_type", "name": "cct2"}, {"value": "char_name", "name": "chn"}, {"value": "cast_info", "name": "ci"}, {"value": "keyword", "name": "k"}, {"value": "kind_type", "name": "kt"}, {"value": "movie_keyword", "name": "mk"}, {"value": "name", "name": "n"}, {"value": "title", "name": "t"}], "where": {"and": [{"eq": ["cct1.kind", {"literal": "cast"}]}, {"like": ["cct2.kind", {"literal": "%complete%"}]}, {"nlike": ["chn.name", {"literal": "%Sherlock%"}]}, {"or": [{"like": ["chn.name", {"literal": "%Tony%Stark%"}]}, {"like": ["chn.name", {"literal": "%Iron%Man%"}]}]}, {"in": ["k.keyword", {"literal": ["superhero", "sequel", "second-part", "marvel-comics", "based-on-comic", "tv-special", "fight", "violence"]}]}, {"eq": ["kt.kind", {"literal": "movie"}]}, {"like": ["n.name", {"literal": "%Downey%Robert%"}]}, {"gt": ["t.production_year", 2000]}, {"eq": ["kt.id", "t.kind_id"]}, {"eq": ["t.id", "mk.movie_id"]}, {"eq": ["t.id", "ci.movie_id"]}, {"eq": ["t.id", "cc.movie_id"]}, {"eq": ["mk.movie_id", "ci.movie_id"]}, {"eq": ["mk.movie_id", "cc.movie_id"]}, {"eq": ["ci.movie_id", "cc.movie_id"]}, {"eq": ["chn.id", "ci.person_role_id"]}, {"eq": ["n.id", "ci.person_id"]}, {"eq": ["k.id", "mk.keyword_id"]}, {"eq": ["cct1.id", "cc.subject_id"]}, {"eq": ["cct2.id", "cc.status_id"]}]}}', 8.40699959, 54568.0898, 2496.75);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (36, '4b.sql', 5, 'SELECT MIN(mi_idx.info) AS rating,
MIN(t.title) AS movie_title
FROM info_type AS it,
keyword AS k,
movie_info_idx AS mi_idx,
movie_keyword AS mk,
title AS t
WHERE it.info =''rating''
AND k.keyword LIKE ''%sequel%''
AND mi_idx.info > ''9.0''
AND t.production_year > 2010
AND t.id = mi_idx.movie_id
AND t.id = mk.movie_id
AND mk.movie_id = mi_idx.movie_id
AND k.id = mk.keyword_id
AND it.id = mi_idx.info_type_id;
', '{"select": [{"value": {"min": "mi_idx.info"}, "name": "rating"}, {"value": {"min": "t.title"}, "name": "movie_title"}], "from": [{"value": "info_type", "name": "it"}, {"value": "keyword", "name": "k"}, {"value": "movie_info_idx", "name": "mi_idx"}, {"value": "movie_keyword", "name": "mk"}, {"value": "title", "name": "t"}], "where": {"and": [{"eq": ["it.info", {"literal": "rating"}]}, {"like": ["k.keyword", {"literal": "%sequel%"}]}, {"gt": ["mi_idx.info", {"literal": "9.0"}]}, {"gt": ["t.production_year", 2010]}, {"eq": ["t.id", "mi_idx.movie_id"]}, {"eq": ["t.id", "mk.movie_id"]}, {"eq": ["mk.movie_id", "mi_idx.movie_id"]}, {"eq": ["k.id", "mk.keyword_id"]}, {"eq": ["it.id", "mi_idx.info_type_id"]}]}}', 0.846000016, 117.505997, 16426.4199);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (37, '22d.sql', 11, 'SELECT MIN(cn.name) AS movie_company,
MIN(mi_idx.info) AS rating,
MIN(t.title) AS western_violent_movie
FROM company_name AS cn,
company_type AS ct,
info_type AS it1,
info_type AS it2,
keyword AS k,
kind_type AS kt,
movie_companies AS mc,
movie_info AS mi,
movie_info_idx AS mi_idx,
movie_keyword AS mk,
title AS t
WHERE cn.country_code != ''[us]''
AND it1.info = ''countries''
AND it2.info = ''rating''
AND k.keyword IN (''murder'',
''murder-in-title'',
''blood'',
''violence'')
AND kt.kind IN (''movie'',
''episode'')
AND mi.info IN (''Sweden'',
''Norway'',
''Germany'',
''Denmark'',
''Swedish'',
''Danish'',
''Norwegian'',
''German'',
''USA'',
''American'')
AND mi_idx.info < ''8.5''
AND t.production_year > 2005
AND kt.id = t.kind_id
AND t.id = mi.movie_id
AND t.id = mk.movie_id
AND t.id = mi_idx.movie_id
AND t.id = mc.movie_id
AND mk.movie_id = mi.movie_id
AND mk.movie_id = mi_idx.movie_id
AND mk.movie_id = mc.movie_id
AND mi.movie_id = mi_idx.movie_id
AND mi.movie_id = mc.movie_id
AND mc.movie_id = mi_idx.movie_id
AND k.id = mk.keyword_id
AND it1.id = mi.info_type_id
AND it2.id = mi_idx.info_type_id
AND ct.id = mc.company_type_id
AND cn.id = mc.company_id;
', '{"select": [{"value": {"min": "cn.name"}, "name": "movie_company"}, {"value": {"min": "mi_idx.info"}, "name": "rating"}, {"value": {"min": "t.title"}, "name": "western_violent_movie"}], "from": [{"value": "company_name", "name": "cn"}, {"value": "company_type", "name": "ct"}, {"value": "info_type", "name": "it1"}, {"value": "info_type", "name": "it2"}, {"value": "keyword", "name": "k"}, {"value": "kind_type", "name": "kt"}, {"value": "movie_companies", "name": "mc"}, {"value": "movie_info", "name": "mi"}, {"value": "movie_info_idx", "name": "mi_idx"}, {"value": "movie_keyword", "name": "mk"}, {"value": "title", "name": "t"}], "where": {"and": [{"neq": ["cn.country_code", {"literal": "[us]"}]}, {"eq": ["it1.info", {"literal": "countries"}]}, {"eq": ["it2.info", {"literal": "rating"}]}, {"in": ["k.keyword", {"literal": ["murder", "murder-in-title", "blood", "violence"]}]}, {"in": ["kt.kind", {"literal": ["movie", "episode"]}]}, {"in": ["mi.info", {"literal": ["Sweden", "Norway", "Germany", "Denmark", "Swedish", "Danish", "Norwegian", "German", "USA", "American"]}]}, {"lt": ["mi_idx.info", {"literal": "8.5"}]}, {"gt": ["t.production_year", 2005]}, {"eq": ["kt.id", "t.kind_id"]}, {"eq": ["t.id", "mi.movie_id"]}, {"eq": ["t.id", "mk.movie_id"]}, {"eq": ["t.id", "mi_idx.movie_id"]}, {"eq": ["t.id", "mc.movie_id"]}, {"eq": ["mk.movie_id", "mi.movie_id"]}, {"eq": ["mk.movie_id", "mi_idx.movie_id"]}, {"eq": ["mk.movie_id", "mc.movie_id"]}, {"eq": ["mi.movie_id", "mi_idx.movie_id"]}, {"eq": ["mi.movie_id", "mc.movie_id"]}, {"eq": ["mc.movie_id", "mi_idx.movie_id"]}, {"eq": ["k.id", "mk.keyword_id"]}, {"eq": ["it1.id", "mi.info_type_id"]}, {"eq": ["it2.id", "mi_idx.info_type_id"]}, {"eq": ["ct.id", "mc.company_type_id"]}, {"eq": ["cn.id", "mc.company_id"]}]}}', 29.1930008, 2998.92993, 7480.25977);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (38, '14b.sql', 8, 'SELECT MIN(mi_idx.info) AS rating,
MIN(t.title) AS western_dark_production
FROM info_type AS it1,
info_type AS it2,
keyword AS k,
kind_type AS kt,
movie_info AS mi,
movie_info_idx AS mi_idx,
movie_keyword AS mk,
title AS t
WHERE it1.info = ''countries''
AND it2.info = ''rating''
AND k.keyword IN (''murder'',
''murder-in-title'')
AND kt.kind = ''movie''
AND mi.info IN (''Sweden'',
''Norway'',
''Germany'',
''Denmark'',
''Swedish'',
''Denish'',
''Norwegian'',
''German'',
''USA'',
''American'')
AND mi_idx.info > ''6.0''
AND t.production_year > 2010
AND (t.title LIKE ''%murder%''
OR t.title LIKE ''%Murder%''
OR t.title LIKE ''%Mord%'')
AND kt.id = t.kind_id
AND t.id = mi.movie_id
AND t.id = mk.movie_id
AND t.id = mi_idx.movie_id
AND mk.movie_id = mi.movie_id
AND mk.movie_id = mi_idx.movie_id
AND mi.movie_id = mi_idx.movie_id
AND k.id = mk.keyword_id
AND it1.id = mi.info_type_id
AND it2.id = mi_idx.info_type_id;
', '{"select": [{"value": {"min": "mi_idx.info"}, "name": "rating"}, {"value": {"min": "t.title"}, "name": "western_dark_production"}], "from": [{"value": "info_type", "name": "it1"}, {"value": "info_type", "name": "it2"}, {"value": "keyword", "name": "k"}, {"value": "kind_type", "name": "kt"}, {"value": "movie_info", "name": "mi"}, {"value": "movie_info_idx", "name": "mi_idx"}, {"value": "movie_keyword", "name": "mk"}, {"value": "title", "name": "t"}], "where": {"and": [{"eq": ["it1.info", {"literal": "countries"}]}, {"eq": ["it2.info", {"literal": "rating"}]}, {"in": ["k.keyword", {"literal": ["murder", "murder-in-title"]}]}, {"eq": ["kt.kind", {"literal": "movie"}]}, {"in": ["mi.info", {"literal": ["Sweden", "Norway", "Germany", "Denmark", "Swedish", "Denish", "Norwegian", "German", "USA", "American"]}]}, {"gt": ["mi_idx.info", {"literal": "6.0"}]}, {"gt": ["t.production_year", 2010]}, {"or": [{"like": ["t.title", {"literal": "%murder%"}]}, {"like": ["t.title", {"literal": "%Murder%"}]}, {"like": ["t.title", {"literal": "%Mord%"}]}]}, {"eq": ["kt.id", "t.kind_id"]}, {"eq": ["t.id", "mi.movie_id"]}, {"eq": ["t.id", "mk.movie_id"]}, {"eq": ["t.id", "mi_idx.movie_id"]}, {"eq": ["mk.movie_id", "mi.movie_id"]}, {"eq": ["mk.movie_id", "mi_idx.movie_id"]}, {"eq": ["mi.movie_id", "mi_idx.movie_id"]}, {"eq": ["k.id", "mk.keyword_id"]}, {"eq": ["it1.id", "mi.info_type_id"]}, {"eq": ["it2.id", "mi_idx.info_type_id"]}]}}', 3.30999994, 145.643997, 4911.2998);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (40, '18a.sql', 7, 'SELECT MIN(mi.info) AS movie_budget,
MIN(mi_idx.info) AS movie_votes,
MIN(t.title) AS movie_title
FROM cast_info AS ci,
info_type AS it1,
info_type AS it2,
movie_info AS mi,
movie_info_idx AS mi_idx,
name AS n,
title AS t
WHERE ci.note IN (''(producer)'',
''(executive producer)'')
AND it1.info = ''budget''
AND it2.info = ''votes''
AND n.gender = ''m''
AND n.name LIKE ''%Tim%''
AND t.id = mi.movie_id
AND t.id = mi_idx.movie_id
AND t.id = ci.movie_id
AND ci.movie_id = mi.movie_id
AND ci.movie_id = mi_idx.movie_id
AND mi.movie_id = mi_idx.movie_id
AND n.id = ci.person_id
AND it1.id = mi.info_type_id
AND it2.id = mi_idx.info_type_id;
', '{"select": [{"value": {"min": "mi.info"}, "name": "movie_budget"}, {"value": {"min": "mi_idx.info"}, "name": "movie_votes"}, {"value": {"min": "t.title"}, "name": "movie_title"}], "from": [{"value": "cast_info", "name": "ci"}, {"value": "info_type", "name": "it1"}, {"value": "info_type", "name": "it2"}, {"value": "movie_info", "name": "mi"}, {"value": "movie_info_idx", "name": "mi_idx"}, {"value": "name", "name": "n"}, {"value": "title", "name": "t"}], "where": {"and": [{"in": ["ci.note", {"literal": ["(producer)", "(executive producer)"]}]}, {"eq": ["it1.info", {"literal": "budget"}]}, {"eq": ["it2.info", {"literal": "votes"}]}, {"eq": ["n.gender", {"literal": "m"}]}, {"like": ["n.name", {"literal": "%Tim%"}]}, {"eq": ["t.id", "mi.movie_id"]}, {"eq": ["t.id", "mi_idx.movie_id"]}, {"eq": ["t.id", "ci.movie_id"]}, {"eq": ["ci.movie_id", "mi.movie_id"]}, {"eq": ["ci.movie_id", "mi_idx.movie_id"]}, {"eq": ["mi.movie_id", "mi_idx.movie_id"]}, {"eq": ["n.id", "ci.person_id"]}, {"eq": ["it1.id", "mi.info_type_id"]}, {"eq": ["it2.id", "mi_idx.info_type_id"]}]}}', 2.70499992, 6979.24609, 143713.906);
INSERT INTO public.queries (id, file_name, relations_num, query, moz, planning, execution, cost) VALUES (41, '17c.sql', 7, 'SELECT MIN(n.name) AS member_in_charnamed_movie,
MIN(n.name) AS a1
FROM cast_info AS ci,
company_name AS cn,
keyword AS k,
movie_companies AS mc,
movie_keyword AS mk,
name AS n,
title AS t
WHERE k.keyword =''character-name-in-title''
AND n.name LIKE ''X%''
AND n.id = ci.person_id
AND ci.movie_id = t.id
AND t.id = mk.movie_id
AND mk.keyword_id = k.id
AND t.id = mc.movie_id
AND mc.company_id = cn.id
AND ci.movie_id = mc.movie_id
AND ci.movie_id = mk.movie_id
AND mc.movie_id = mk.movie_id;
', '{"select": [{"value": {"min": "n.name"}, "name": "member_in_charnamed_movie"}, {"value": {"min": "n.name"}, "name": "a1"}], "from": [{"value": "cast_info", "name": "ci"}, {"value": "company_name", "name": "cn"}, {"value": "keyword", "name": "k"}, {"value": "movie_companies", "name": "mc"}, {"value": "movie_keyword", "name": "mk"}, {"value": "name", "name": "n"}, {"value": "title", "name": "t"}], "where": {"and": [{"eq": ["k.keyword", {"literal": "character-name-in-title"}]}, {"like": ["n.name", {"literal": "X%"}]}, {"eq": ["n.id", "ci.person_id"]}, {"eq": ["ci.movie_id", "t.id"]}, {"eq": ["t.id", "mk.movie_id"]}, {"eq": ["mk.keyword_id", "k.id"]}, {"eq": ["t.id", "mc.movie_id"]}, {"eq": ["mc.company_id", "cn.id"]}, {"eq": ["ci.movie_id", "mc.movie_id"]}, {"eq": ["ci.movie_id", "mk.movie_id"]}, {"eq": ["mc.movie_id", "mk.movie_id"]}]}}', 2.76300001, 11126.79, 4393.58008);