摘要:
记录经过优化后出现问题的SQL
优化后出现问题的SQL
Q2:
select
s_acctbal,
s_name,
n_name,
p_partkey,
p_mfgr,
s_address,
s_phone,
s_comment
from
part,
supplier,
partsupp,
nation,
region
where
p_partkey = ps_partkey
and s_suppkey = ps_suppkey
and p_size = 15
and p_type like '%BRASS'
and s_nationkey = n_nationkey
and n_regionkey = r_regionkey
and r_name = 'EUROPE'
and ps_supplycost = (
select
min(ps_supplycost)
from
partsupp,
supplier,
nation,
region
where
p_partkey = ps_partkey
and s_suppkey = ps_suppkey
and s_nationkey = n_nationkey
and n_regionkey = r_regionkey
and r_name = 'EUROPE'
)
order by
s_acctbal desc,
n_name,
s_name,
p_partkey
limit 100;
问题:
查出结果为空
对比下mysql8的查询结果:
mysql> select
-> s_acctbal,
-> s_name,
-> n_name,
-> p_partkey,
-> p_mfgr,
-> s_address,
-> s_phone,
-> s_comment
-> from
-> part,
-> supplier,
-> partsupp,
-> nation,
-> region
-> where
-> p_partkey = ps_partkey
-> and s_suppkey = ps_suppkey
-> and p_size = 15
-> and p_type like '%BRASS'
-> and s_nationkey = n_nationkey
-> and n_regionkey = r_regionkey
-> and r_name = 'EUROPE'
-> and ps_supplycost = (
-> select
-> min(ps_supplycost)
-> from
-> partsupp,
-> supplier,
-> nation,
-> region
-> where
-> p_partkey = ps_partkey
-> and s_suppkey = ps_suppkey
-> and s_nationkey = n_nationkey
-> and n_regionkey = r_regionkey
-> and r_name = 'EUROPE'
-> )
-> order by
-> s_acctbal desc,
-> n_name,
-> s_name,
-> p_partkey
-> limit 100;
+-----------+--------------------+----------------+-----------+----------------+------------------------------------------+-----------------+------------------------------------------------------------------------------------------------------+
| s_acctbal | s_name | n_name | p_partkey | p_mfgr | s_address | s_phone | s_comment |
+-----------+--------------------+----------------+-----------+----------------+------------------------------------------+-----------------+------------------------------------------------------------------------------------------------------+
| 9994.37 | Supplier#000030084 | GERMANY | 380077 | Manufacturer#5 | gBEvSkyW o1uHea0CV,oHtkTTVW | 17-519-171-6883 | pinto beans sleep fluffily alongside of the slyly special deposits. slyly pendi |
| 9992.54 | Supplier#000099650 | RUSSIA | 824625 | Manufacturer#3 | ySI FMlh9gHkEDN6gQWf3 | 32-971-481-2533 | ged deposits cajole carefully packages. carefully final ideas affix furiously. regu |
| 9987.51 | Supplier#000020657 | ROMANIA | 395653 | Manufacturer#5 | 4pL,8BT3Yun,17QHqAr9 A,ZFyyuH4L | 29-167-460-7830 | otes. excuses behind the blithely regular packages are furio |
| 9986.40 | Supplier#000082995 | RUSSIA | 1782994 | Manufacturer#5 | CXiBNZ6DUBjgY | 32-510-919-3096 | nding instructions boost. unusual, regular asymptotes above the fluffily express e |
| 9984.69 | Supplier#000008875 | ROMANIA | 633856 | Manufacturer#4 | hRdOqKqyU,sHq | 29-132-904-4395 | ong the bold pinto beans are furiously blithely slow |
| 9984.30 | Supplier#000081977 | RUSSIA | 1356963 | Manufacturer#5 | gemeY46TI2J6ZAt9gjouxB | 32-569-570-6149 | ng to the furiously special package |
| 9983.76 | Supplier#000024757 | RUSSIA | 599751 | Manufacturer#4 | vJb,kFRqwsv34H5Y6GsRAEJXz0VCZ | 32-868-781-9721 | nal foxes. theodolites cajole regular, final grouches. unusual, final theodolites lose |
| 9980.25 | Supplier#000067392 | RUSSIA | 192388 | Manufacturer#2 | oEQvrLi316,0I7Z | 32-872-236-1034 | nal pinto beans cajole quickly. final excuses about the deposits |
| 9974.93 | Supplier#000072260 | ROMANIA | 397250 | Manufacturer#3 | ijrpECIzgkK,qi83qjKtf0qhMX4O3i17i | 29-745-482-4154 | its above the special deposits engage slyly among the unusual, even asymptotes. carefull |
| 9971.99 | Supplier#000016715 | FRANCE | 691708 | Manufacturer#2 | BjEu56DmMNx VHZ | 16-401-454-3384 | even requests; fluffily ironic |
| 9968.96 | Supplier#000085431 | ROMANIA | 1885430 | Manufacturer#4 | 1hhUdxO7AVH | 29-402-887-2528 | boost furiously blithely quiet requests. ironic, ironic instructions haggle slowly. ironic, un |
| 9967.60 | Supplier#000028837 | ROMANIA | 228836 | Manufacturer#2 | gAaNbDxVTyFjjhgGodAKyy9uk | 29-105-576-2294 | hins must have to haggle blithely along |
| 9967.60 | Supplier#000028837 | ROMANIA | 1828836 | Manufacturer#4 | gAaNbDxVTyFjjhgGodAKyy9uk | 29-105-576-2294 | hins must have to haggle blithely along |
| 9966.67 | Supplier#000030306 | UNITED KINGDOM | 1280281 | Manufacturer#3 | y2Pslsn3B1KRWYKtcwMMcOzYZUel4ox5Rzp | 33-758-232-4917 | lyly special packages around the |
| 9962.57 | Supplier#000034645 | ROMANIA | 759623 | Manufacturer#4 | eX2phCtgj8wVd8U7oWYs6bQOayC | 29-629-100-1429 | uests sleep carefully besides the patterns. carefully regular forges |
| 9957.83 | Supplier#000012588 | ROMANIA | 12587 | Manufacturer#1 | 8cRzJOxCG7z qpfkXKgrQs6ubfOTK | 29-373-772-7126 | uriously ironic platelets nag. slyly bold instructions haggle furiously fluffil |
| 9956.67 | Supplier#000074260 | FRANCE | 124257 | Manufacturer#2 | W83 2W,pP8sFtnVxjOJC1a7zO5 | 16-511-538-8136 | yly ironic ideas try to are! final platelets above the final |
| 9945.36 | Supplier#000036819 | ROMANIA | 761797 | Manufacturer#4 | NJfzlpQ4TqMDtYWAjXM9kFSjqTs7ZnIwHmUvT | 29-370-897-9499 | al accounts. carefully ruthless requests haggle blithely express depos |
| 9944.02 | Supplier#000010019 | ROMANIA | 1810018 | Manufacturer#4 | 6fy8i iDm,kCwJfaiNRZtVWeAtrLnQT | 29-695-919-1392 | y regular excuses are blithely special theodolites. final excuses sleep |
| 9942.90 | Supplier#000019177 | GERMANY | 494172 | Manufacturer#5 | TUINeTTQPDi7DOcYue | 17-316-670-1231 | s wake furiously according to the depths. slyly express |
| 9940.76 | Supplier#000031587 | GERMANY | 556571 | Manufacturer#5 | qOjHNzlw4i7XT7tr7JU2P2rY3d | 17-221-164-2555 | ect fluffily. fluffily even instructions sleep quickly careful |
| 9939.40 | Supplier#000028113 | RUSSIA | 428112 | Manufacturer#2 | HrnOoqKBep02Dvafwz9SHIzaJWlL | 32-938-722-6528 | ideas. ruthlessly ironic accounts should are slyly special, regular pla |
| 9939.40 | Supplier#000028113 | RUSSIA | 1253076 | Manufacturer#5 | HrnOoqKBep02Dvafwz9SHIzaJWlL | 32-938-722-6528 | ideas. ruthlessly ironic accounts should are slyly special, regular pla |
| 9938.69 | Supplier#000048337 | RUSSIA | 1448336 | Manufacturer#5 | tXGAix6fSBfdQuOu4BBAQDsnVsCzxzFK8g1 | 32-566-156-5537 | ular pinto beans. slyly express theodolites sleep blithely |
| 9938.58 | Supplier#000094826 | FRANCE | 1494825 | Manufacturer#4 | 2QpjZspOzpdUre9zk9,IoeNDxm2 | 16-253-529-1094 | ideas. ruthlessly sly package |
| 9937.53 | Supplier#000042994 | GERMANY | 1442993 | Manufacturer#3 | Q,AdU5BqQwPC2rGbrydanSbbEU6PoTPf | 17-429-634-1843 | aggle carefully along the quickly even |
| 9936.01 | Supplier#000064630 | FRANCE | 1289593 | Manufacturer#5 | cW3kNfLGiN2n7w84pIHEpTd4sewgpnW | 16-782-698-5265 | . furiously express ideas boost across the regular requests. furiously final ideas haggle fl |
| 9936.00 | Supplier#000042253 | ROMANIA | 142252 | Manufacturer#4 | r9uqFbAWydd4tcgzcS RI Y | 29-148-772-1827 | lar packages haggle. blithely ir |
| 9934.88 | Supplier#000096830 | FRANCE | 621811 | Manufacturer#3 | Kr0JO9SLORE9w jyf0SmllIw6z4TwSWMM qbLG | 16-418-502-3708 | theodolites sublate. quickly unusual theodolites according to the regular, ironic |
| 9934.44 | Supplier#000009762 | GERMANY | 1234725 | Manufacturer#4 | sszbnlE,8rTVV1n5PUnUaX | 17-758-315-1893 | uriously unusual foxes. bold, ironic foxes according to the blithely final |
| 9932.47 | Supplier#000068671 | UNITED KINGDOM | 568670 | Manufacturer#1 | KxbfreN6sK oIUYlebYYCDveczKvlNjPZ2GBZmZ | 33-345-114-7234 | final foxes sleep carefully. final, ironic pinto beans after the special deposits h |
| 9923.62 | Supplier#000037153 | UNITED KINGDOM | 562137 | Manufacturer#1 | sU34QleurYe 2uU9bQO,O Zg4yiKw6NDEy,fu | 33-691-756-3666 | special ideas need to detect quickly final dependencies. furiously regular packages above the sl |
| 9920.24 | Supplier#000051485 | GERMANY | 1376445 | Manufacturer#2 | ZrSnSNxfvsD8KBgRrZzHKm,wrv2DtPf3 | 17-317-540-3763 | -- slyly even escapades sleep carefully a |
| 9918.88 | Supplier#000082683 | UNITED KINGDOM | 1932644 | Manufacturer#1 | RR7y BiYXqJaw | 33-114-482-3385 | nding instructions along the blithely regular ideas affix according to the ironic requests. careful |
| 9915.38 | Supplier#000006085 | ROMANIA | 1506084 | Manufacturer#5 | T3Ju68MUhIb2hpTO3f8OGG | 29-528-113-9241 | iously bold sauternes. slyly regular asymptotes |
| 9909.28 | Supplier#000066602 | GERMANY | 1341588 | Manufacturer#2 | HK9pwZa9eIhUuatBkdSGzqobKxSwTlI h,GoXX | 17-803-997-4487 | ideas are slyly final ideas. quickly ironic |
| 9909.28 | Supplier#000066602 | GERMANY | 1791550 | Manufacturer#3 | HK9pwZa9eIhUuatBkdSGzqobKxSwTlI h,GoXX | 17-803-997-4487 | ideas are slyly final ideas. quickly ironic |
| 9902.07 | Supplier#000075736 | RUSSIA | 650729 | Manufacturer#2 | 2AtAHp8CVxxvbVBEv0wTjQNxtS99HlJ | 32-923-189-5079 | oxes wake furiously carefully final foxes. slyly |
| 9900.50 | Supplier#000059434 | UNITED KINGDOM | 59433 | Manufacturer#3 | j8s26GZ4EF6vzq9oIRsspI2zt Usst | 33-696-691-9604 | regular foxes throughout the p |
| 9898.61 | Supplier#000059419 | FRANCE | 1509388 | Manufacturer#2 | Czn 4yp4BFP3cdO9KVpcEVKfF4 | 16-660-798-1130 | y regular accounts. quickly dogged Tiresias across the blithely pending theodolit |
| 9897.41 | Supplier#000017795 | UNITED KINGDOM | 667782 | Manufacturer#5 | A5a1lovY,yQoSHaYon5cGgo1l | 33-398-227-1033 | express accounts haggle blithely. furiously ironic requests cajole quickly. quickly final fo |
| 9892.10 | Supplier#000042566 | RUSSIA | 992547 | Manufacturer#2 | bpLCiCVwl6uxYR | 32-550-577-4769 | inal platelets against the requests detect according to the carefully express in |
| 9892.10 | Supplier#000042566 | RUSSIA | 1217553 | Manufacturer#5 | bpLCiCVwl6uxYR | 32-550-577-4769 | inal platelets against the requests detect according to the carefully express in |
| 9888.93 | Supplier#000090097 | RUSSIA | 515081 | Manufacturer#1 | x OQ8Y TUEzuI | 32-748-779-9791 | eas sublate furiously final excuse |
| 9884.84 | Supplier#000082184 | UNITED KINGDOM | 1907126 | Manufacturer#2 | 2UNwl4Atkn | 33-406-348-8224 | ual dependencies try to sleep furiously inside the quickly spe |
| 9884.20 | Supplier#000068361 | GERMANY | 1968360 | Manufacturer#2 | MRev0hTbR9Y5xEPUZxM28 | 17-385-307-2876 | gular asymptotes sleep slyly |
| 9880.10 | Supplier#000042667 | GERMANY | 817658 | Manufacturer#5 | 4fQZB7L5eZDVs | 17-847-751-8418 | ly final packages alongside of the unus |
| 9878.75 | Supplier#000028803 | RUSSIA | 1478774 | Manufacturer#1 | f1mPa2ts2TUCbZ9UVmuDuu2lXLgfYTP | 32-220-759-7420 | y final accounts. blithely silent deposits doubt blithely. carefully pending ide |
| 9878.75 | Supplier#000028803 | RUSSIA | 1703785 | Manufacturer#4 | f1mPa2ts2TUCbZ9UVmuDuu2lXLgfYTP | 32-220-759-7420 | y final accounts. blithely silent deposits doubt blithely. carefully pending ide |
| 9875.72 | Supplier#000073719 | FRANCE | 1898664 | Manufacturer#2 | PiOw jtgZx,FXj iaUxNmxVEyVo77IjYqACcjk | 16-823-901-3878 | wake slyly about the ironic, ironic accounts. fluffily express |
| 9874.90 | Supplier#000040624 | GERMANY | 140623 | Manufacturer#1 | 4S0T3NXSEFH2VzqIwkvbItm3eFFe0iWpwbV19SFz | 17-233-896-4431 | haggle closely across the slyly fluf |
| 9873.90 | Supplier#000058391 | GERMANY | 508380 | Manufacturer#3 | FA 45I,q ODAcIxWEE4 Gb,m1p5eFW2sCoclCLs | 17-311-740-7234 | al, regular platelets. ironic deposits haggle slyly against the bo |
| 9872.81 | Supplier#000097316 | ROMANIA | 272313 | Manufacturer#4 | cJ7G0pfLTWOAp4QFtksmmGR1CTCI | 29-726-802-1880 | ts sleep fluffily. carefully regular deposits alongside o |
| 9871.22 | Supplier#000006373 | GERMANY | 556362 | Manufacturer#5 | J8fcXWsTqM | 17-813-485-8637 | etect blithely bold asymptotes. fluffily ironic platelets wake furiously; blit |
| 9870.58 | Supplier#000027835 | ROMANIA | 1977796 | Manufacturer#3 | rQNlJWtDotXE8GK5FXID,jbkVsRFB87ZUZyK | 29-103-673-6501 | heodolites. regular packages cajole. |
| 9869.98 | Supplier#000081446 | FRANCE | 556440 | Manufacturer#1 | xQnnVgu PfVo | 16-912-320-8438 | nal dependencies. pinto beans |
| 9869.66 | Supplier#000016553 | ROMANIA | 291550 | Manufacturer#4 | MBv6xbbVlLii9w9b5uBo | 29-212-862-7077 | eposits sleep pinto beans. deposits eat ironically. carefully silent courts against the slyly silent |
| 9868.44 | Supplier#000062507 | ROMANIA | 1862506 | Manufacturer#5 | 1dePPGFWYYK | 29-895-360-4525 | ependencies solve slyly. slyly unusual accounts detect blithe, express requests. furiously |
| 9865.69 | Supplier#000011713 | ROMANIA | 511712 | Manufacturer#1 | z21Y9930sRTsTgOIo omLTfWderX82DVdPVsgs | 29-368-999-1073 | ccounts haggle quickly. blithely even accounts boost according to the blithely express pack |
| 9860.62 | Supplier#000022993 | ROMANIA | 1447950 | Manufacturer#4 | PQI K09e2jt,pfHRHzN1,lhY3Vkwlf | 29-602-372-7262 | nto beans. special asymptotes cajole after the bli |
| 9860.24 | Supplier#000029047 | FRANCE | 154043 | Manufacturer#2 | 9YOTHZrVjWbI6nF1P | 16-229-827-8211 | kly. fluffily special theodolites along the busily |
| 9859.93 | Supplier#000052771 | ROMANIA | 602758 | Manufacturer#5 | rdFyHz5FV1FCi2jmFFCZAPlPyH xevioB | 29-926-286-5299 | among the packages cajole carefully ironic dugouts. fluffily final pinto b |
| 9856.43 | Supplier#000045738 | UNITED KINGDOM | 645737 | Manufacturer#3 | qd7jaGTfaxX Fhamq84AagYXv3IqU0oIEjBC | 33-394-523-3413 | es. fluffy deposits run caref |
| 9852.52 | Supplier#000008973 | RUSSIA | 483968 | Manufacturer#3 | t5L67YdBYYH6o,Vz24jpDyQ9 | 32-188-594-7038 | rns wake final foxes. carefully unusual depende |
| 9850.90 | Supplier#000066053 | UNITED KINGDOM | 441048 | Manufacturer#1 | C,IWe7RpG WHdg2ZS | 33-766-582-8615 | final, ironic requests cajole fluffily blithely reg |
| 9850.90 | Supplier#000066053 | UNITED KINGDOM | 916034 | Manufacturer#3 | C,IWe7RpG WHdg2ZS | 33-766-582-8615 | final, ironic requests cajole fluffily blithely reg |
| 9850.15 | Supplier#000062925 | FRANCE | 512914 | Manufacturer#2 | aXKdkhctDBlg, | 16-757-400-1683 | its. blithely regular platelets outside the slyly iro |
| 9849.09 | Supplier#000034097 | FRANCE | 609090 | Manufacturer#1 | PRUY1riC CmZl90q0AEl | 16-172-883-1928 | ounts. blithely busy requests affix about the final requests. blithely regular accounts use aga |
| 9849.06 | Supplier#000021254 | GERMANY | 1796236 | Manufacturer#5 | 9Q,ItS4plqXR7HCHkG3Pkm5BM | 17-623-110-6693 | dogged requests wake furiously. regular, r |
| 9848.73 | Supplier#000091096 | UNITED KINGDOM | 1566080 | Manufacturer#3 | jmrZln1W,XSTx Rbwq,N1eR8 | 33-848-379-3222 | o the quickly pending excuses; dependencie |
| 9846.72 | Supplier#000062848 | UNITED KINGDOM | 1937828 | Manufacturer#1 | X,xtORbtbgOKftLdqgigKBdjFQgPprW,GG | 33-325-481-7818 | among the carefully special deposits. deposits shall detect regular packages. bold packages cajol |
| 9837.53 | Supplier#000005414 | RUSSIA | 1905413 | Manufacturer#3 | yDLmG4bxYA1iviZ71PkEtzcDoB0KT | 32-204-830-9105 | y through the fluffily ruthless platelets; furiously si |
| 9837.43 | Supplier#000046552 | FRANCE | 1121540 | Manufacturer#2 | ,cgeykS01djUU95zLM2Hpe | 16-424-132-3669 | inal requests boost slyly pending pinto beans. unusual, |
| 9835.16 | Supplier#000029961 | UNITED KINGDOM | 754939 | Manufacturer#4 | gHq2sGgnKZl | 33-411-329-7177 | s. ideas boost around the carefully |
| 9831.95 | Supplier#000057380 | ROMANIA | 1682331 | Manufacturer#5 | OISAlNhoacPOx | 29-915-260-4712 | ans wake special, special ideas. r |
| 9825.33 | Supplier#000089770 | ROMANIA | 1414727 | Manufacturer#3 | R0u11qwGLDTo8M7t | 29-209-173-8510 | along the enticingly bold accounts-- furiou |
| 9824.72 | Supplier#000072517 | ROMANIA | 1097486 | Manufacturer#2 | OFw3m2x5TO3TyLdMPFm7mT28ijWoHZBPU5W6ty | 29-615-917-5641 | ideas maintain carefully. carefully bold din |
| 9822.22 | Supplier#000003440 | UNITED KINGDOM | 1978420 | Manufacturer#2 | 93S5pntmWhw R6U4ZD ROQ,2gI17b3 | 33-495-208-7899 | ake carefully after the fluffily re |
| 9818.98 | Supplier#000060094 | GERMANY | 1110071 | Manufacturer#4 | P8CrJmDT2lihE | 17-293-298-6268 | nt ideas along the quickly express theodolites doze slyly quickly careful pinto |
| 9814.50 | Supplier#000019945 | ROMANIA | 894936 | Manufacturer#1 | Y6YcWcdK31rTOxGAYA,oZKgaoyzBPgQ | 29-732-301-5529 | blithely fluffy packages. sl |
| 9813.27 | Supplier#000055123 | ROMANIA | 1480080 | Manufacturer#1 | bDiIx yNRXcigioRWmNxDwV Kp3b172yzY4 | 29-736-401-5608 | boost quickly above the enticing, final asymptotes. carefully |
| 9809.56 | Supplier#000078281 | FRANCE | 778280 | Manufacturer#4 | a5zMC6gsO4eu40xEGompp9EG5Bcv2 | 16-497-471-5554 | ar deposits snooze quickly furiou |
| 9808.25 | Supplier#000012649 | ROMANIA | 1162626 | Manufacturer#1 | MdUWGpibJY uamEuhvpWzgyzyDn Uxl8QYkdCqbU | 29-622-551-4334 | he regular pinto beans are fluffily since the u |
| 9807.53 | Supplier#000000437 | GERMANY | 1000436 | Manufacturer#1 | HuqIk0sK4yC6x5be,cTlPrFqqBCHYf | 17-652-134-3031 | usly bold deposits about the pending |
| 9801.15 | Supplier#000089681 | RUSSIA | 1339654 | Manufacturer#5 | xBuy1Gwgi5s0LIYoP2qU7Y7qBu1ZumPkLMufsB | 32-947-140-8833 | ly! quickly express theodolites nag slyly |
| 9799.89 | Supplier#000059082 | GERMANY | 1934062 | Manufacturer#2 | tr cwsr N4ip | 17-243-631-5701 | quickly express foxes across the bold, regular instructions wake carefully after the slyly spec |
| 9793.99 | Supplier#000020982 | ROMANIA | 170979 | Manufacturer#4 | sJZSIUlkU7lQXctqmnWO5IXLF | 29-164-384-7339 | ts are along the furiously regular deposits. reg |
| 9793.99 | Supplier#000020982 | ROMANIA | 1095971 | Manufacturer#4 | sJZSIUlkU7lQXctqmnWO5IXLF | 29-164-384-7339 | ts are along the furiously regular deposits. reg |
| 9789.61 | Supplier#000034881 | GERMANY | 284876 | Manufacturer#4 | Vc3Dnx0Mwm05YAR | 17-237-600-1480 | ependencies above the regular packages nag blithel |
| 9788.73 | Supplier#000083261 | FRANCE | 1258248 | Manufacturer#4 | 1eof4IF4xyXiEgrc,FcLV7SHf | 16-653-115-5484 | to beans. quickly even dolphins are. requests sl |
| 9784.65 | Supplier#000099527 | FRANCE | 624508 | Manufacturer#4 | 6 RcgjZXcv0E8w2yY | 16-658-692-3768 | cajole carefully grouches-- sometimes ironic accounts use among the blithely ironic packages. f |
| 9777.85 | Supplier#000044409 | GERMANY | 1419394 | Manufacturer#5 | ihO3vpaZcvYCpo71g9Mo8BbPh8w | 17-739-859-5666 | ress accounts nag against the fluffily unusual requests. bold |
| 9777.75 | Supplier#000030124 | RUSSIA | 355114 | Manufacturer#4 | vQT4tgo EJSFpgBqp35tVK1,p3n8 Rv | 32-554-818-8924 | ounts sleep slyly above the regular dolphins! regular excuses sleep daringly |
| 9777.60 | Supplier#000039017 | UNITED KINGDOM | 164013 | Manufacturer#1 | JXisDqw4Put4nbXRjinbDql9gVo,m3ECxwaXeI | 33-324-389-9325 | uriously final asymptotes believe furiously |
| 9777.60 | Supplier#000039017 | UNITED KINGDOM | 1188994 | Manufacturer#3 | JXisDqw4Put4nbXRjinbDql9gVo,m3ECxwaXeI | 33-324-389-9325 | uriously final asymptotes believe furiously |
| 9777.37 | Supplier#000071253 | GERMANY | 1496210 | Manufacturer#1 | YXp8hJjinRZ | 17-239-283-7205 | ven pinto beans. bold accounts sleep fur |
| 9771.20 | Supplier#000065102 | UNITED KINGDOM | 1690053 | Manufacturer#2 | 8b5sN46HiHIoEUvAflzruKFvrp | 33-225-255-3440 | ally around the slyly ironic packages. furiously |
| 9769.57 | Supplier#000043082 | UNITED KINGDOM | 1568036 | Manufacturer#3 | Me4vwdA0gZmQE8uDrP | 33-958-753-9986 | even deposits are fluffily after the slyly special theodolites. slyly ironic accounts hag |
| 9767.32 | Supplier#000073781 | FRANCE | 1823744 | Manufacturer#4 | LWLjymYpnPf1VxJkBpbausoKS2RpXWVZWBOD | 16-282-344-5601 | nstructions haggle after the express, express courts. fluffily ironic foxes according t |
| 9766.22 | Supplier#000066352 | GERMANY | 1516321 | Manufacturer#3 | ZcFNrwzNDkzf7PzdO0 | 17-427-880-3444 | e of the regular foxes. ironic d |
+-----------+--------------------+----------------+-----------+----------------+------------------------------------------+-----------------+------------------------------------------------------------------------------------------------------+
100 rows in set (6.52 sec)
Q2问题分析:
SQL拆分分布执行测试
内部子查询:
mysql> select
-> min(ps_supplycost)
-> from
-> partsupp,
-> supplier,
-> nation,
-> region,
-> part
-> where
-> p_partkey = ps_partkey
-> and s_suppkey = ps_suppkey
-> and s_nationkey = n_nationkey
-> and n_regionkey = r_regionkey
-> and r_name = 'EUROPE';
+--------------------+
| min(ps_supplycost) |
+--------------------+
| 1.00 |
+--------------------+
1 row in set (25.07 sec)
用const量替换子查询结果
mysql> select
-> s_acctbal,
-> s_name,
-> n_name,
-> p_partkey,
-> p_mfgr,
-> s_address,
-> s_phone,
-> s_comment
-> from
-> part,
-> supplier,
-> partsupp,
-> nation,
-> region
-> where
-> p_partkey = ps_partkey
-> and s_suppkey = ps_suppkey
-> and p_size = 15
-> and p_type like '%BRASS'
-> and s_nationkey = n_nationkey
-> and n_regionkey = r_regionkey
-> and r_name = 'EUROPE'
-> and ps_supplycost = 1
-> order by
-> s_acctbal desc,
-> n_name,
-> s_name,
-> p_partkey
-> limit 10;
Empty set (0.25 sec)
去除p_partkey = ps_partkey条件
mysql> select
-> s_acctbal,
-> s_name,
-> n_name,
-> p_partkey,
-> p_mfgr,
-> s_address,
-> s_phone,
-> s_comment
-> from
-> part,
-> supplier,
-> partsupp,
-> nation,
-> region
-> where
-> s_suppkey = ps_suppkey
-> and p_size = 15
-> and p_type like '%BRASS'
-> and s_nationkey = n_nationkey
-> and n_regionkey = r_regionkey
-> and r_name = 'EUROPE'
-> and ps_supplycost = 1
-> order by
-> s_acctbal desc,
-> n_name,
-> s_name,
-> p_partkey
-> limit 10;
+-----------+--------------------+--------+-----------+----------------+--------------+-----------------+-----------------------------------------------------------------+
| s_acctbal | s_name | n_name | p_partkey | p_mfgr | s_address | s_phone | s_comment |
+-----------+--------------------+--------+-----------+----------------+--------------+-----------------+-----------------------------------------------------------------+
| 9822.85 | Supplier#000097100 | FRANCE | 249 | Manufacturer#4 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 323 | Manufacturer#4 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 1015 | Manufacturer#4 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 1634 | Manufacturer#2 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 2037 | Manufacturer#1 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 2156 | Manufacturer#5 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 3080 | Manufacturer#2 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 3563 | Manufacturer#1 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 3822 | Manufacturer#5 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 3873 | Manufacturer#5 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
+-----------+--------------------+--------+-----------+----------------+--------------+-----------------+-----------------------------------------------------------------+
10 rows in set (1.21 sec)
去除p_partkey = ps_partkey条件且使用子查询
mysql> select
-> s_acctbal,
-> s_name,
-> n_name,
-> p_partkey,
-> p_mfgr,
-> s_address,
-> s_phone,
-> s_comment
-> from
-> part,
-> supplier,
-> partsupp,
-> nation,
-> region
-> where
-> s_suppkey = ps_suppkey
-> and p_size = 15
-> and p_type like '%BRASS'
-> and s_nationkey = n_nationkey
-> and n_regionkey = r_regionkey
-> and r_name = 'EUROPE'
-> and ps_supplycost = (
-> select
-> min(ps_supplycost)
-> from
-> partsupp,
-> supplier,
-> nation,
-> region,
-> part
-> where
-> p_partkey = ps_partkey
-> and s_suppkey = ps_suppkey
-> and s_nationkey = n_nationkey
-> and n_regionkey = r_regionkey
-> and r_name = 'EUROPE'
-> )
-> order by
-> s_acctbal desc,
-> n_name,
-> s_name,
-> p_partkey
-> limit 10;
+-----------+--------------------+--------+-----------+----------------+--------------+-----------------+-----------------------------------------------------------------+
| s_acctbal | s_name | n_name | p_partkey | p_mfgr | s_address | s_phone | s_comment |
+-----------+--------------------+--------+-----------+----------------+--------------+-----------------+-----------------------------------------------------------------+
| 9822.85 | Supplier#000097100 | FRANCE | 249 | Manufacturer#4 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 323 | Manufacturer#4 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 1015 | Manufacturer#4 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 1634 | Manufacturer#2 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 2037 | Manufacturer#1 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 2156 | Manufacturer#5 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 3080 | Manufacturer#2 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 3563 | Manufacturer#1 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 3822 | Manufacturer#5 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 3873 | Manufacturer#5 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
+-----------+--------------------+--------+-----------+----------------+--------------+-----------------+-----------------------------------------------------------------+
10 rows in set (25.85 sec)
仅使用条件p_partkey = ps_partkey
mysql> select
-> s_acctbal,
-> s_name,
-> n_name,
-> p_partkey,
-> p_mfgr,
-> s_address,
-> s_phone,
-> s_comment
-> from
-> part,
-> supplier,
-> partsupp,
-> nation,
-> region
-> where
-> p_partkey = ps_partkey
-> limit 10;
+-----------+--------------------+-----------+-----------+----------------+-------------------------------------+-----------------+------------------------------+
| s_acctbal | s_name | n_name | p_partkey | p_mfgr | s_address | s_phone | s_comment |
+-----------+--------------------+-----------+-----------+----------------+-------------------------------------+-----------------+------------------------------+
| 5755.94 | Supplier#000000001 | ALGERIA | 1 | Manufacturer#1 | N kD4on9OM Ipw3,gf0JBoQDd7tgrzrddZ | 27-918-335-1736 | each slyly above the careful |
| 5755.94 | Supplier#000000001 | ARGENTINA | 1 | Manufacturer#1 | N kD4on9OM Ipw3,gf0JBoQDd7tgrzrddZ | 27-918-335-1736 | each slyly above the careful |
| 5755.94 | Supplier#000000001 | BRAZIL | 1 | Manufacturer#1 | N kD4on9OM Ipw3,gf0JBoQDd7tgrzrddZ | 27-918-335-1736 | each slyly above the careful |
| 5755.94 | Supplier#000000001 | CANADA | 1 | Manufacturer#1 | N kD4on9OM Ipw3,gf0JBoQDd7tgrzrddZ | 27-918-335-1736 | each slyly above the careful |
| 5755.94 | Supplier#000000001 | EGYPT | 1 | Manufacturer#1 | N kD4on9OM Ipw3,gf0JBoQDd7tgrzrddZ | 27-918-335-1736 | each slyly above the careful |
| 5755.94 | Supplier#000000001 | ETHIOPIA | 1 | Manufacturer#1 | N kD4on9OM Ipw3,gf0JBoQDd7tgrzrddZ | 27-918-335-1736 | each slyly above the careful |
| 5755.94 | Supplier#000000001 | FRANCE | 1 | Manufacturer#1 | N kD4on9OM Ipw3,gf0JBoQDd7tgrzrddZ | 27-918-335-1736 | each slyly above the careful |
| 5755.94 | Supplier#000000001 | GERMANY | 1 | Manufacturer#1 | N kD4on9OM Ipw3,gf0JBoQDd7tgrzrddZ | 27-918-335-1736 | each slyly above the careful |
| 5755.94 | Supplier#000000001 | INDIA | 1 | Manufacturer#1 | N kD4on9OM Ipw3,gf0JBoQDd7tgrzrddZ | 27-918-335-1736 | each slyly above the careful |
| 5755.94 | Supplier#000000001 | INDONESIA | 1 | Manufacturer#1 | N kD4on9OM Ipw3,gf0JBoQDd7tgrzrddZ | 27-918-335-1736 | each slyly above the careful |
+-----------+--------------------+-----------+-----------+----------------+-------------------------------------+-----------------+------------------------------+
10 rows in set (4.21 sec)
仅去除ps_supplycost = 1的条件
mysql> select
-> s_acctbal,
-> s_name,
-> n_name,
-> p_partkey,
-> p_mfgr,
-> s_address,
-> s_phone,
-> s_comment
-> from
-> part,
-> supplier,
-> partsupp,
-> nation,
-> region
-> where
-> p_partkey = ps_partkey
-> and s_suppkey = ps_suppkey
-> and p_size = 15
-> and p_type like '%BRASS'
-> and s_nationkey = n_nationkey
-> and n_regionkey = r_regionkey
-> and r_name = 'EUROPE'
-> order by
-> s_acctbal desc,
-> n_name,
-> s_name,
-> p_partkey
-> limit 10;
+-----------+--------------------+---------+-----------+----------------+-----------------------------------+-----------------+------------------------------------------------------------------------------------------+
| s_acctbal | s_name | n_name | p_partkey | p_mfgr | s_address | s_phone | s_comment |
+-----------+--------------------+---------+-----------+----------------+-----------------------------------+-----------------+------------------------------------------------------------------------------------------+
| 9994.37 | Supplier#000030084 | GERMANY | 380077 | Manufacturer#5 | gBEvSkyW o1uHea0CV,oHtkTTVW | 17-519-171-6883 | pinto beans sleep fluffily alongside of the slyly special deposits. slyly pendi |
| 9992.54 | Supplier#000099650 | RUSSIA | 824625 | Manufacturer#3 | ySI FMlh9gHkEDN6gQWf3 | 32-971-481-2533 | ged deposits cajole carefully packages. carefully final ideas affix furiously. regu |
| 9987.51 | Supplier#000020657 | ROMANIA | 395653 | Manufacturer#5 | 4pL,8BT3Yun,17QHqAr9 A,ZFyyuH4L | 29-167-460-7830 | otes. excuses behind the blithely regular packages are furio |
| 9986.40 | Supplier#000082995 | RUSSIA | 1782994 | Manufacturer#5 | CXiBNZ6DUBjgY | 32-510-919-3096 | nding instructions boost. unusual, regular asymptotes above the fluffily express e |
| 9984.69 | Supplier#000008875 | ROMANIA | 633856 | Manufacturer#4 | hRdOqKqyU,sHq | 29-132-904-4395 | ong the bold pinto beans are furiously blithely slow |
| 9984.30 | Supplier#000081977 | RUSSIA | 1356963 | Manufacturer#5 | gemeY46TI2J6ZAt9gjouxB | 32-569-570-6149 | ng to the furiously special package |
| 9983.76 | Supplier#000024757 | RUSSIA | 599751 | Manufacturer#4 | vJb,kFRqwsv34H5Y6GsRAEJXz0VCZ | 32-868-781-9721 | nal foxes. theodolites cajole regular, final grouches. unusual, final theodolites lose |
| 9980.25 | Supplier#000067392 | RUSSIA | 192388 | Manufacturer#2 | oEQvrLi316,0I7Z | 32-872-236-1034 | nal pinto beans cajole quickly. final excuses about the deposits |
| 9974.93 | Supplier#000072260 | ROMANIA | 397250 | Manufacturer#3 | ijrpECIzgkK,qi83qjKtf0qhMX4O3i17i | 29-745-482-4154 | its above the special deposits engage slyly among the unusual, even asymptotes. carefull |
| 9974.93 | Supplier#000072260 | ROMANIA | 1847241 | Manufacturer#1 | ijrpECIzgkK,qi83qjKtf0qhMX4O3i17i | 29-745-482-4154 | its above the special deposits engage slyly among the unusual, even asymptotes. carefull |
+-----------+--------------------+---------+-----------+----------------+-----------------------------------+-----------------+------------------------------------------------------------------------------------------+
10 rows in set (8.45 sec)
去除子查询的s_suppkey = ps_suppkey条件
mysql> select
-> s_acctbal,
-> s_name,
-> n_name,
-> p_partkey,
-> p_mfgr,
-> s_address,
-> s_phone,
-> s_comment
-> from
-> part,
-> supplier,
-> partsupp,
-> nation,
-> region
-> where
-> s_suppkey = ps_suppkey
-> and p_size = 15
-> and p_type like '%BRASS'
-> and s_nationkey = n_nationkey
-> and n_regionkey = r_regionkey
-> and r_name = 'EUROPE'
-> and ps_supplycost = (
-> select
-> min(ps_supplycost)
-> from
-> partsupp,
-> supplier,
-> nation,
-> region
-> where
-> s_suppkey = ps_suppkey
-> and s_nationkey = n_nationkey
-> and n_regionkey = r_regionkey
-> and r_name = 'EUROPE'
-> )
-> order by
-> s_acctbal desc,
-> n_name,
-> s_name,
-> p_partkey
-> limit 10;
+-----------+--------------------+--------+-----------+----------------+--------------+-----------------+-----------------------------------------------------------------+
| s_acctbal | s_name | n_name | p_partkey | p_mfgr | s_address | s_phone | s_comment |
+-----------+--------------------+--------+-----------+----------------+--------------+-----------------+-----------------------------------------------------------------+
| 9822.85 | Supplier#000097100 | FRANCE | 249 | Manufacturer#4 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 323 | Manufacturer#4 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 1015 | Manufacturer#4 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 1634 | Manufacturer#2 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 2037 | Manufacturer#1 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 2156 | Manufacturer#5 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 3080 | Manufacturer#2 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 3563 | Manufacturer#1 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 3822 | Manufacturer#5 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 3873 | Manufacturer#5 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
+-----------+--------------------+--------+-----------+----------------+--------------+-----------------+-----------------------------------------------------------------+
10 rows in set (8.65 sec)
子查询中存在条件p_partkey = ps_partkey时
mysql> select
-> min(ps_supplycost)
-> from
-> partsupp,
-> supplier,
-> nation,
-> region,
-> part
-> where
-> p_partkey = ps_partkey
-> and s_suppkey = ps_suppkey
-> and s_nationkey = n_nationkey
-> and n_regionkey = r_regionkey
-> and r_name = 'EUROPE';
+--------------------+
| min(ps_supplycost) |
+--------------------+
| 1.00 |
+--------------------+
1 row in set (21.92 sec)
子查询中没有条件p_partkey = ps_partkey时
mysql> select
-> min(ps_supplycost)
-> from
-> partsupp,
-> supplier,
-> nation,
-> region,
-> part
-> where
-> s_suppkey = ps_suppkey
-> and s_nationkey = n_nationkey
-> and n_regionkey = r_regionkey
-> and r_name = 'EUROPE';
+--------------------+
| min(ps_supplycost) |
+--------------------+
| 1.00 |
+--------------------+
1 row in set (8.00 sec)
测试结果:
外部与子查询中的p_partkey = ps_partkey条件,任何一个存在,都导致查询结果为空
mysql> select
-> s_acctbal,
-> s_name,
-> n_name,
-> p_partkey,
-> p_mfgr,
-> s_address,
-> s_phone,
-> s_comment
-> from
-> part,
-> supplier,
-> partsupp,
-> nation,
-> region
-> where
-> s_suppkey = ps_suppkey
-> and p_size = 15
-> and p_type like '%BRASS'
-> and s_nationkey = n_nationkey
-> and n_regionkey = r_regionkey
-> and r_name = 'EUROPE'
-> and ps_supplycost = (
-> select
-> min(ps_supplycost)
-> from
-> partsupp,
-> supplier,
-> nation,
-> region
-> where
-> s_suppkey = ps_suppkey
-> and s_nationkey = n_nationkey
-> and n_regionkey = r_regionkey
-> and r_name = 'EUROPE'
-> )
-> order by
-> s_acctbal desc,
-> n_name,
-> s_name,
-> p_partkey
-> limit 10;
+-----------+--------------------+--------+-----------+----------------+--------------+-----------------+-----------------------------------------------------------------+
| s_acctbal | s_name | n_name | p_partkey | p_mfgr | s_address | s_phone | s_comment |
+-----------+--------------------+--------+-----------+----------------+--------------+-----------------+-----------------------------------------------------------------+
| 9822.85 | Supplier#000097100 | FRANCE | 249 | Manufacturer#4 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 323 | Manufacturer#4 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 1015 | Manufacturer#4 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 1634 | Manufacturer#2 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 2037 | Manufacturer#1 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 2156 | Manufacturer#5 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 3080 | Manufacturer#2 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 3563 | Manufacturer#1 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 3822 | Manufacturer#5 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
| 9822.85 | Supplier#000097100 | FRANCE | 3873 | Manufacturer#5 | tb1gKkaBAniS | 16-489-642-7398 | sly final platelets cajole. furiously even deposits use daringl |
+-----------+--------------------+--------+-----------+----------------+--------------+-----------------+-----------------------------------------------------------------+
10 rows in set (9.18 sec)
partsupp表中的ps_suppkey列缺失对等的数据
*************************** 100. row ***************************
s_acctbal: 9766.22
s_name: Supplier#000066352
n_name: GERMANY
p_partkey: 1516321
p_mfgr: Manufacturer#3
s_address: ZcFNrwzNDkzf7PzdO0
s_phone: 17-427-880-3444
s_comment: e of the regular foxes. ironic d
p_partkey: 1516321
ps_partkey: 1516321
100 rows in set (1.13 sec)
*************************** 23. row ***************************
s_acctbal: -686.61
s_name: Supplier#000012210
n_name: RUSSIA
p_partkey: 1516321
p_mfgr: Manufacturer#3
s_address: jW0N5R,fhhKq309PWv1ItFhE Iyt
s_phone: 32-345-565-3726
s_comment: pliers are slyly final epitaphs. furiously regular requests sleep furiously always regular a
ps_supplycost: 1.00
p_partkey: 1516321
ps_suppkey: 12210
23 rows in set (8.15 sec)
mysql> select
-> s_acctbal,
-> s_name,
-> n_name,
-> p_partkey,
-> p_mfgr,
-> s_address,
-> s_phone,
-> s_comment,
-> ps_supplycost,
-> p_partkey,
-> ps_suppkey
-> from
-> part,
-> supplier,
-> partsupp,
-> nation,
-> region
-> where
-> s_suppkey = ps_suppkey
-> and p_size = 15
-> and p_type like '%BRASS'
-> and s_nationkey = n_nationkey
-> and n_regionkey = r_regionkey
-> and r_name = 'EUROPE'
-> and ps_partkey = 1516321
-> and ps_supplycost = (
-> select
-> min(ps_supplycost)
-> from
-> partsupp,
-> supplier,
-> nation,
-> region
-> where
-> s_suppkey = ps_suppkey
-> and s_nationkey = n_nationkey
-> and n_regionkey = r_regionkey
-> and r_name = 'EUROPE'
-> )
-> order by
-> s_acctbal desc,
-> n_name,
-> s_name,
-> p_partkey\G
Empty set (7.97 sec)