Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 select statement to slow with in clause

Author  Topic 

vladicaognjanovic
Starting Member

26 Posts

Posted - 2007-02-05 : 08:00:55
We have a simple problem, but no solution. (my english is not so good)
Let say we have a table, A, with one column, id, (primary key, index clusterd) and that table have 130000 rows.
In bussines logic at one point we have 26000 ids and we have to do some filtering with ids. (Filtering can be done with derived or temp tables), but the question is: How to put 26000 ids in query. We tried with with “in “ it’s to slow, main problem is that select statement like “select A.id from A where A.id in (id1, id2, …)” runs for about 12s and that is not expectable. Can some give as an idea how to do this smarter.

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-02-05 : 08:05:33
You can try EXISTS predicate. It is much better option.

Select A.id from A where exists
(select * from SomeTable B where B.id = A.id)


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-02-05 : 08:06:28
try to use exists


select *
from table1 t
where exists (select * from table2 x where x.id = t.id))


Maybe you can post a specific query and someone here can help to optimize it.


KH

Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-02-05 : 08:06:57



KH

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-02-05 : 08:26:18
Why not a INNER JOIN?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

vladicaognjanovic
Starting Member

26 Posts

Posted - 2007-02-05 : 10:21:44
One thing I forgot to say ids are from table A, and base on that temp table we do filtering., I tryed exists and not much beter results.
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-02-05 : 10:26:51
Post complete query that you tried along with temp table structure. May be somebody can comeup with good solution.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

vladicaognjanovic
Starting Member

26 Posts

Posted - 2007-02-05 : 10:31:45
select [DST_test].[dbo].[fundamental].[fundamental_id] from [DST_test].[dbo].[fundamental] where [DST_test].[dbo].[fundamental].[fundamental_id] in (382480, 382481, 382482, 382483, 382484, 135, 136, 137, 157, 173, 382456, 382457, 382458, 382473, 382474, 382475, 382476, 382477, 382478, 382479, 382440, 382441, 382442, 382443, 382444, 382445, 382452, 382453, 382454, 382455, 382430, 382431, 382432, 382433, 382434, 382435, 382436, 382437, 382438, 382439, 382420, 382421, 382422, 382423, 382424, 382425, 382426, 382427, 382428, 382429, 381958, 381959, 381960, 381972, 382316, 382317, 382406, 382407, 382408, 382419, 381824, 381825, 381826, 381855, 381885, 381886, 381887, 381888, 381952, 381957, 381733, 381734, 381735, 381751, 381792, 381793, 381794, 381795, 381796, 381823, 381591, 381615, 381616, 381617, 381618, 381651, 381652, 381653, 381654, 381732, 381490, 381491, 381507, 381509, 381510, 381535, 381580, 381581, 381582, 381583, 381370, 381371, 381378, 381383, 381400, 381412, 381413, 381414, 381486, 381489, 381267, 381268, 381295, 381296, 381330, 381335, 381336, 381337, 381347, 381369, 381085, 381086, 381087, 381088, 381089, 381090, 381249, 381250, 381251, 381260, 381075, 381076, 381077, 381078, 381079, 381080, 381081, 381082, 381083, 381084, 381065, 381066, 381067, 381068, 381069, 381070, 381071, 381072, 381073, 381074, 381055, 381056, 381057, 381058, 381059, 381060, 381061, 381062, 381063, 381064, 381045, 381046, 381047, 381048, 381049, 381050, 381051, 381052, 381053, 381054, 380770, 380771, 380772, 381038, 381039, 381040, 381041, 381042, 381043, 381044, 380760, 380761, 380762, 380763, 380764, 380765, 380766, 380767, 380768, 380769, 380750, 380751, 380752, 380753, 380754, 380755, 380756, 380757, 380758, 380759, 380740, 380741, 380742, 380743, 380744, 380745, 380746, 380747, 380748, 380749, 380730, 380731, 380732, 380733, 380734, 380735, 380736, 380737, 380738, 380739, 380720, 380721, 380722, 380723, 380724, 380725, 380726, 380727, 380728, 380729, 380005, 380006, 380007, 380008, 380009, 380010, 380011, 380012, 380013, 380014, 379995, 379996, 379997, 379998, 379999, 380000, 380001, 380002, 380003, 380004, 379985, 379986, 379987, 379988, 379989, 379990, 379991, 379992, 379993, 379994, 379975, 379976, 379977, 379978, 379979, 379980, 379981, 379982, 379983, 379984, 379101, 379116, 379131, 379143, 379155, 379167, 379187, 379202, 379217, 379610, 378944, 378959, 378977, 378989, 379011, 379022, 379041, 379056, 379071, 379086, 378891, 378892, 378899, 378900, 378902, 378903, 378910, 378911, 378916, 378934) union select [DST_test].[dbo].[fundamental].[fundamental_id] from [DST_test].[dbo].[fundamental] where [DST_test].[dbo].[fundamental].[fundamental_id] in (378824, 378825, 378826, 378827, 378840, 378842, 378849, 378850, 378853, 378854, 378794, 378801, 378802, 378804, 378805, 378812, 378813, 378815, 378816, 378821, 378776, 378782, 378785, 378786, 378787, 378788, 378789, 378790, 378791, 378793, 378757, 378758, 378759, 378760, 378765, 378768, 378769, 378770, 378771, 378774, 378731, 378732, 378738, 378741, 378742, 378743, 378744, 378745, 378753, 378756, 378706, 378707, 378708, 378714, 378717, 378718, 378719, 378720, 378721, 378725, 378680, 378688, 378691, 378692, 378693, 378694, 378695, 378701, 378704, 378705, 378663, 378664, 378665, 378666, 378667, 378673, 378676, 378677, 378678, 378679, 378639, 378640, 378641, 378647, 378650, 378651, 378652, 378653, 378654, 378660, 378615, 378621, 378624, 378625, 378626, 378627, 378628, 378634, 378637, 378638, 378598, 378599, 378600, 378601, 378602, 378608, 378611, 378612, 378613, 378614, 378574, 378575, 378576, 378582, 378585, 378586, 378587, 378588, 378589, 378595, 378550, 378551, 378556, 378559, 378560, 378561, 378562, 378569, 378572, 378573, 378530, 378532, 378533, 378534, 378535, 378536, 378544, 378547, 378548, 378549, 378511, 378512, 378513, 378514, 378519, 378521, 378522, 378523, 378524, 378525, 378483, 378484, 378495, 378497, 378498, 378499, 378500, 378501, 378507, 378510, 378329, 378332, 378345, 378422, 378423, 378473, 378479, 378480, 378481, 378482, 378165, 378172, 378305, 378306, 378308, 378309, 378314, 378325, 378326, 378328, 378144, 378147, 378151, 378152, 378154, 378155, 378157, 378161, 378162, 378164, 378120, 378124, 378128, 378129, 378130, 378131, 378136, 378140, 378141, 378143, 378094, 378099, 378104, 378105, 378107, 378108, 378112, 378116, 378117, 378119, 378070, 378073, 378077, 378078, 378080, 378081, 378086, 378090, 378091, 378093, 378051, 378054, 378058, 378059, 378061, 378062, 378065, 378066, 378067, 378069, 378027, 378030, 378035, 378036, 378038, 378039, 378043, 378047, 378048, 378050, 378001, 378005, 378009, 378010, 378012, 378013, 378019, 378023, 378024, 378026, 377977, 377982, 377986, 377987, 377989, 377990, 377993, 377997, 377998, 378000, 377956, 377959, 377963, 377964, 377966, 377967, 377969, 377973, 377974, 377976, 377931, 377936, 377940, 377941, 377943, 377944, 377948, 377952, 377953, 377955, 377907, 377908, 377912, 377913, 377914, 377917, 377918, 377925, 377926, 377929, 377887, 377889, 377893, 377894, 377899, 377900, 377901, 377904, 377905, 377906) union select [DST_test].[dbo].[fundamental].[fundamental_id] from [DST_test].[dbo].[fundamental] where [DST_test].[dbo].[fundamental].[fundamental_id] in (377821, 377823, 377824, 377827, 377842, 377856, 377857, 377875, 377879, 377886, 377802, 377803, 377806, 377810, 377811, 377812, 377813, 377814, 377819, 377820, 377791, 377792, 377793, 377794, 377795, 377796, 377797, 377799, 377800, 377801, 377780, 377781, 377783, 377784, 377785, 377786, 377787, 377788, 377789, 377790, 377761, 377762, 377763, 377766, 377770, 377771, 377772, 377773, 377774, 377779, 377747, 377748, 377749, 377753, 377754, 377755, 377757, 377758, 377759, 377760, 377732, 377733, 377734, 377735, 377736, 377737, 377740, 377744, 377745, 377746, 377708, 377711, 377712, 377713, 377714, 377721, 377722, 377727, 377728, 377731, 377698, 377699, 377700, 377701, 377702, 377703, 377704, 377705, 377706, 377707, 377688, 377689, 377690, 377691, 377692, 377693, 377694, 377695, 377696, 377697, 377677, 377678, 377679, 377680, 377681, 377682, 377683, 377684, 377685, 377686, 377659, 377660, 377661, 377662, 377663, 377664, 377665, 377674, 377675, 377676, 377651, 377652, 377652, 377653, 377653, 377654, 377655, 377656, 377657, 377658, 377646, 377647, 377647, 377648, 377648, 377649, 377649, 377650, 377650, 377651, 377641, 377642, 377642, 377643, 377643, 377644, 377644, 377645, 377645, 377646, 377633, 377634, 377635, 377636, 377637, 377638, 377639, 377640, 377640, 377641, 377623, 377624, 377625, 377626, 377627, 377628, 377629, 377630, 377631, 377632, 377606, 377607, 377608, 377613, 377614, 377616, 377619, 377620, 377621, 377622, 377587, 377590, 377591, 377592, 377595, 377596, 377597, 377600, 377604, 377605, 377571, 377572, 377573, 377575, 377576, 377579, 377583, 377584, 377585, 377586, 377551, 377553, 377554, 377555, 377558, 377562, 377563, 377564, 377565, 377566, 377532, 377533, 377536, 377540, 377541, 377542, 377543, 377544, 377549, 377550, 377514, 377518, 377519, 377520, 377521, 377522, 377527, 377528, 377529, 377531, 377498, 377499, 377500, 377501, 377504, 377505, 377506, 377509, 377510, 377511, 377478, 377479, 377484, 377485, 377486, 377488, 377489, 377490, 377493, 377497, 377461, 377462, 377463, 377466, 377467, 377468, 377471, 377475, 377476, 377477, 377442, 377445, 377446, 377447, 377450, 377454, 377455, 377456, 377457, 377458, 377425, 377426, 377429, 377433, 377434, 377435, 377436, 377437, 377440, 377441, 377406, 377409, 377413, 377414, 377415, 377416, 377419, 377420, 377421, 377424, 377391, 377392, 377393, 377394, 377395, 377400, 377401, 377402, 377404, 377405) union select [DST_test].[dbo].[fundamental].[fundamental_id] from [DST_test].[dbo].[fundamental] where [DST_test].[dbo].[fundamental].[fundamental_id] in (377371, 377372, 377377, 377378, 377379, 377381, 377382, 377383, 377384, 377387, 377355, 377357, 377358, 377359, 377360, 377363, 377367, 377368, 377369, 377370, 377337, 377340, 377344, 377345, 377346, 377347, 377348, 377349, 377353, 377354, 377322, 377323, 377324, 377325, 377330, 377331, 377332, 377334, 377335, 377336, 377302, 377303, 377308, 377309, 377311, 377312, 377313, 377316, 377320, 377321, 377286, 377288, 377289, 377290, 377291, 377294, 377298, 377299, 377300, 377301, 377269, 377273, 377274, 377275, 377276, 377277, 377278, 377279, 377284, 377285, 377252, 377253, 377254, 377255, 377260, 377261, 377262, 377264, 377265, 377266, 377232, 377237, 377238, 377239, 377241, 377242, 377243, 377244, 377250, 377251, 377216, 377217, 377219, 377220, 377221, 377222, 377225, 377229, 377230, 377231, 377197, 377198, 377201, 377205, 377206, 377207, 377208, 377209, 377210, 377215, 377182, 377183, 377184, 377185, 377186, 377191, 377192, 377193, 377195, 377196, 377162, 377163, 377168, 377169, 377170, 377172, 377173, 377174, 377175, 377178, 377146, 377147, 377148, 377150, 377151, 377152, 377155, 377159, 377160, 377161, 377127, 377128, 377129, 377132, 377136, 377137, 377138, 377139, 377140, 377141, 377112, 377113, 377114, 377115, 377116, 377117, 377122, 377123, 377124, 377126, 377092, 377093, 377098, 377099, 377100, 377102, 377103, 377104, 377105, 377108, 377076, 377077, 377079, 377080, 377081, 377084, 377088, 377089, 377090, 377091, 377057, 377060, 377064, 377065, 377066, 377067, 377068, 377069, 377070, 377075, 377042, 377043, 377044, 377045, 377050, 377051, 377052, 377054, 377055, 377056, 377026, 377027, 377028, 377030, 377031, 377032, 377035, 377039, 377040, 377041, 377007, 377008, 377009, 377012, 377016, 377017, 377018, 377019, 377020, 377021, 376719, 376720, 376723, 376724, 376725, 376726, 376859, 376860, 376882, 376883, 376699, 376700, 376701, 376702, 376707, 376708, 376711, 376712, 376713, 376714, 376677, 376678, 376683, 376684, 376687, 376688, 376689, 376690, 376695, 376696, 376659, 376660, 376663, 376664, 376665, 376666, 376671, 376672, 376675, 376676, 376639, 376640, 376641, 376642, 376647, 376648, 376651, 376652, 376653, 376654, 376617, 376618, 376623, 376624, 376627, 376628, 376629, 376630, 376635, 376636, 376599, 376600, 376603, 376604, 376605, 376606, 376611, 376612, 376615, 376616, 376579, 376580, 376581, 376582, 376587, 376588, 376591, 376592, 376593, 376594) union select [DST_test].[dbo].[fundamental].[fundamental_id] from [DST_test].[dbo].[fundamental] where [DST_test].[dbo].[fundamental].[fundamental_id] in (376557, 376558, 376563, 376564, 376567, 376568, 376569, 376570, 376575, 376576, 376539, 376540, 376543, 376544, 376545, 376546, 376551, 376552, 376555, 376556, 376519, 376520, 376521, 376522, 376527, 376528, 376531, 376532, 376533, 376534, 376497, 376498, 376503, 376504, 376507, 376508, 376509, 376510, 376515, 376516, 376479, 376480, 376483, 376484, 376485, 376486, 376491, 376492, 376495, 376496, 376459, 376460, 376461, 376462, 376467, 376468, 376471, 376472, 376473, 376474, 376437, 376438, 376443, 376444, 376447, 376448, 376449, 376450, 376455, 376456, 376419, 376420, 376423, 376424, 376425, 376426, 376431, 376432, 376435, 376436, 376399, 376400, 376401, 376402, 376407, 376408, 376411, 376412, 376413, 376414, 376377, 376378, 376383, 376384, 376387, 376388, 376389, 376390, 376395, 376396, 376357, 376360, 376361, 376363, 376364, 376365, 376371, 376372, 376375, 376376, 376281, 376282, 376283, 376284, 376285, 376286, 376287, 376288, 376289, 376290, 376271, 376272, 376273, 376274, 376275, 376276, 376277, 376278, 376279, 376280, 376260, 376261, 376262, 376263, 376264, 376265, 376266, 376268, 376269, 376270, 376236, 376237, 376238, 376244, 376254, 376255, 376256, 376257, 376258, 376259, 376226, 376227, 376228, 376229, 376230, 376231, 376232, 376233, 376234, 376235, 376221, 376222, 376222, 376223, 376223, 376224, 376224, 376225, 376225, 376226, 376216, 376217, 376217, 376218, 376218, 376219, 376219, 376220, 376220, 376221, 376210, 376211, 376212, 376213, 376213, 376214, 376214, 376215, 376215, 376216, 376200, 376201, 376202, 376203, 376204, 376205, 376206, 376207, 376208, 376209, 376188, 376189, 376190, 376191, 376192, 376193, 376194, 376195, 376198, 376199, 376178, 376179, 376180, 376181, 376182, 376183, 376184, 376185, 376186, 376187, 376167, 376168, 376169, 376170, 376171, 376173, 376174, 376175, 376176, 376177, 376143, 376149, 376159, 376160, 376161, 376162, 376163, 376164, 376165, 376166, 376133, 376134, 376135, 376136, 376137, 376138, 376139, 376140, 376141, 376142, 376127, 376128, 376128, 376129, 376129, 376130, 376130, 376131, 376131, 376132, 376122, 376123, 376123, 376124, 376124, 376125, 376125, 376126, 376126, 376127, 376117, 376118, 376118, 376119, 376119, 376120, 376120, 376121, 376121, 376122, 376107, 376108, 376109, 376110, 376111, 376112, 376113, 376114, 376115, 376116, 376095, 376096, 376097, 376098, 376099, 376102, 376103, 376104, 376105, 376106) union select [DST_test].[dbo].[fundamental].[fundamental_id] from [DST_test].[dbo].[fundamental] where [DST_test].[dbo].[fundamental].[fundamental_id] in (376085, 376086, 376087, 376088, 376089, 376090, 376091, 376092, 376093, 376094, 376074, 376075, 376077, 376078, 376079, 376080, 376081, 376082, 376083, 376084, 376064, 376065, 376066, 376067, 376068, 376069, 376070, 376071, 376072, 376073, 376040, 376041, 376042, 376043, 376044, 376045, 376046, 376047, 376053, 376063, 376033, 376033, 376034, 376034, 376035, 376035, 376036, 376037, 376038, 376039, 376028, 376028, 376029, 376029, 376030, 376030, 376031, 376031, 376032, 376032, 376023, 376023, 376024, 376024, 376025, 376025, 376026, 376026, 376027, 376027, 376014, 376015, 376016, 376017, 376018, 376019, 376020, 376021, 376022, 376022, 376002, 376003, 376006, 376007, 376008, 376009, 376010, 376011, 376012, 376013, 375992, 375993, 375994, 375995, 375996, 375997, 375998, 375999, 376000, 376001, 375982, 375983, 375984, 375985, 375986, 375987, 375988, 375989, 375990, 375991, 375971, 375972, 375973, 375974, 375975, 375976, 375977, 375978, 375979, 375981, 375947, 375948, 375949, 375950, 375951, 375957, 375967, 375968, 375969, 375970, 375938, 375939, 375939, 375940, 375941, 375942, 375943, 375944, 375945, 375946, 375933, 375934, 375934, 375935, 375935, 375936, 375936, 375937, 375937, 375938, 375928, 375929, 375929, 375930, 375930, 375931, 375931, 375932, 375932, 375933, 375921, 375922, 375923, 375924, 375925, 375926, 375926, 375927, 375927, 375928, 375911, 375912, 375913, 375914, 375915, 375916, 375917, 375918, 375919, 375920, 375899, 375900, 375901, 375902, 375903, 375904, 375905, 375906, 375907, 375910, 375889, 375890, 375891, 375892, 375893, 375894, 375895, 375896, 375897, 375898, 375878, 375879, 375880, 375881, 375882, 375883, 375885, 375886, 375887, 375888, 375854, 375855, 375861, 375871, 375872, 375873, 375874, 375875, 375876, 375877, 375844, 375845, 375846, 375847, 375848, 375849, 375850, 375851, 375852, 375853, 375839, 375839, 375840, 375840, 375841, 375841, 375842, 375842, 375843, 375843, 375834, 375834, 375835, 375835, 375836, 375836, 375837, 375837, 375838, 375838, 375828, 375829, 375830, 375830, 375831, 375831, 375832, 375832, 375833, 375833, 375818, 375819, 375820, 375821, 375822, 375823, 375824, 375825, 375826, 375827, 375806, 375807, 375808, 375809, 375810, 375811, 375814, 375815, 375816, 375817, 375796, 375797, 375798, 375799, 375800, 375801, 375802, 375803, 375804, 375805, 375785, 375786, 375787, 375789, 375790, 375791, 375792, 375793, 375794, 375795) union select [DST_test].[dbo].[fundamental].[fundamental_id] from [DST_test].[dbo].[fundamental] where [DST_test].[dbo].[fundamental].[fundamental_id] in (375775, 375776, 375777, 375778, 375779, 375780, 375781, 375782, 375783, 375784, 375751, 375752, 375753, 375754, 375755, 375756, 375757, 375758, 375759, 375765, 375744, 375745, 375745, 375746, 375746, 375747, 375747, 375748, 375749, 375750, 375739, 375740, 375740, 375741, 375741, 375742, 375742, 375743, 375743, 375744, 375734, 375735, 375735, 375736, 375736, 375737, 375737, 375738, 375738, 375739, 375725, 375726, 375727, 375728, 375729, 375730, 375731, 375732, 375733, 375734, 375713, 375714, 375715, 375718, 375719, 375720, 375721, 375722, 375723, 375724, 375703, 375704, 375705, 375706, 375707, 375708, 375709, 375710, 375711, 375712, 375693, 375694, 375695, 375696, 375697, 375698, 375699, 375700, 375701, 375702, 375682, 375683, 375684, 375685, 375686, 375687, 375688, 375689, 375690, 375691, 375658, 375659, 375660, 375661, 375662, 375663, 375669, 375679, 375680, 375681, 375650, 375650, 375651, 375651, 375652, 375653, 375654, 375655, 375656, 375657, 375645, 375645, 375646, 375646, 375647, 375647, 375648, 375648, 375649, 375649, 375640, 375640, 375641, 375641, 375642, 375642, 375643, 375643, 375644, 375644, 375632, 375633, 375634, 375635, 375636, 375637, 375638, 375638, 375639, 375639, 375622, 375623, 375624, 375625, 375626, 375627, 375628, 375629, 375630, 375631, 375610, 375611, 375612, 375613, 375614, 375615, 375616, 375617, 375618, 375619, 375600, 375601, 375602, 375603, 375604, 375605, 375606, 375607, 375608, 375609, 375589, 375590, 375591, 375592, 375593, 375594, 375595, 375597, 375598, 375599, 375565, 375566, 375567, 375573, 375583, 375584, 375585, 375586, 375587, 375588, 375555, 375556, 375557, 375558, 375559, 375560, 375561, 375562, 375563, 375564, 375550, 375551, 375551, 375552, 375552, 375553, 375553, 375554, 375554, 375555, 375545, 375546, 375546, 375547, 375547, 375548, 375548, 375549, 375549, 375550, 375539, 375540, 375541, 375542, 375542, 375543, 375543, 375544, 375544, 375545, 375529, 375530, 375531, 375532, 375533, 375534, 375535, 375536, 375537, 375538, 373854, 373855, 373959, 373964, 373965, 373966, 373987, 375339, 375527, 375528, 373762, 373763, 373834, 373835, 373844, 373849, 373850, 373851, 373852, 373853, 373724, 373732, 373733, 373734, 373735, 373749, 373755, 373759, 373760, 373761, 373682, 373683, 373684, 373685, 373692, 373697, 373698, 373699, 373700, 373707, 373580, 373585, 373586, 373587, 373588, 373625, 373626, 373627, 373628, 373667) union select [DST_test].[dbo].[fundamental].[fundamental_id] from [DST_test].[dbo].[fundamental] where [DST_test].[dbo].[fundamental].[fundamental_id] in (373478, 373479, 373483, 373484, 373503, 373504, 373511, 373512, 373529, 373530, 373416, 373424, 373426, 373427, 373428, 373429, 373458, 373461, 373476, 373477, 373342, 373366, 373367, 373368, 373376, 373389, 373393, 373394, 373395, 373396, 373295, 373296, 373303, 373304, 373305, 373306, 373307, 373308, 373309, 373341, 373217, 373224, 373226, 373229, 373254, 373257, 373258, 373259, 373264, 373265, 373158, 373159, 373160, 373181, 373182, 373183, 373184, 373185, 373215, 373216, 373113, 373115, 373116, 373118, 373121, 373122, 373123, 373147, 373151, 373157, 373051, 373054, 373058, 373064, 373065, 373066, 373067, 373084, 373089, 373090, 372978, 372991, 372992, 372993, 372994, 372995, 373047, 373048, 373049, 373050, 372651, 372652, 372653, 372654, 372655, 372656, 372657, 372685, 372976, 372977, 372641, 372642, 372643, 372644, 372645, 372646, 372647, 372648, 372649, 372650, 372631, 372632, 372633, 372634, 372635, 372636, 372637, 372638, 372639, 372640, 370942, 370943, 370944, 370945, 370947, 370950, 372627, 372628, 372629, 372630, 370670, 370700, 370701, 370702, 370793, 370794, 370803, 370913, 370939, 370940, 370650, 370656, 370659, 370660, 370661, 370662, 370663, 370667, 370668, 370669, 370629, 370630, 370632, 370639, 370641, 370642, 370643, 370644, 370645, 370649, 370609, 370610, 370614, 370615, 370618, 370619, 370620, 370621, 370626, 370628, 369604, 369605, 369667, 369668, 369697, 369698, 370090, 370091, 370092, 370605, 369508, 369509, 369524, 369525, 369542, 369543, 369558, 369559, 369574, 369575, 369003, 369004, 369005, 369008, 369433, 369434, 369476, 369477, 369496, 369497, 368993, 368994, 368995, 368996, 368997, 368998, 368999, 369000, 369001, 369002, 368983, 368984, 368985, 368986, 368987, 368988, 368989, 368990, 368991, 368992, 368972, 368973, 368974, 368975, 368976, 368977, 368978, 368979, 368980, 368981, 368948, 368949, 368950, 368951, 368952, 368953, 368959, 368969, 368970, 368971, 368940, 368940, 368941, 368941, 368942, 368943, 368944, 368945, 368946, 368947, 368935, 368935, 368936, 368936, 368937, 368937, 368938, 368938, 368939, 368939, 368930, 368930, 368931, 368931, 368932, 368932, 368933, 368933, 368934, 368934, 368922, 368923, 368924, 368925, 368926, 368927, 368928, 368928, 368929, 368929, 368912, 368913, 368914, 368915, 368916, 368917, 368918, 368919, 368920, 368921, 368900, 368901, 368902, 368903, 368904, 368905, 368906, 368907, 368908, 368909) union select [DST_test].[dbo].[fundamental].[fundamental_id] from [DST_test].[dbo].[fundamental] where [DST_test].[dbo].[fundamental].[fundamental_id] in (368890, 368891, 368892, 368893, 368894, 368895, 368896, 368897, 368898, 368899, 368879, 368880, 368881, 368882, 368883, 368884, 368885, 368887, 368888, 368889, 368855, 368856, 368857, 368863, 368873, 368874, 368875, 368876, 368877, 368878, 368845, 368846, 368847, 368848, 368849, 368850, 368851, 368852, 368853, 368854, 368840, 368841, 368841, 368842, 368842, 368843, 368843, 368844, 368844, 368845, 368835, 368836, 368836, 368837, 368837, 368838, 368838, 368839, 368839, 368840, 368829, 368830, 368831, 368832, 368832, 368833, 368833, 368834, 368834, 368835, 368819, 368820, 368821, 368822, 368823, 368824, 368825, 368826, 368827, 368828, 368807, 368808, 368809, 368810, 368811, 368812, 368813, 368816, 368817, 368818, 368797, 368798, 368799, 368800, 368801, 368802, 368803, 368804, 368805, 368806, 368786, 368787, 368788, 368789, 368791, 368792, 368793, 368794, 368795, 368796, 368767, 368777, 368778, 368779, 368780, 368781, 368782, 368783, 368784, 368785, 368752, 368753, 368754, 368755, 368756, 368757, 368758, 368759, 368760, 368761, 368746, 368746, 368747, 368747, 368748, 368748, 368749, 368749, 368750, 368751, 368741, 368741, 368742, 368742, 368743, 368743, 368744, 368744, 368745, 368745, 368736, 368736, 368737, 368737, 368738, 368738, 368739, 368739, 368740, 368740, 368726, 368727, 368728, 368729, 368730, 368731, 368732, 368733, 368734, 368735, 368714, 368715, 368716, 368717, 368720, 368721, 368722, 368723, 368724, 368725, 368704, 368705, 368706, 368707, 368708, 368709, 368710, 368711, 368712, 368713, 368693, 368695, 368696, 368697, 368698, 368699, 368700, 368701, 368702, 368703, 368683, 368684, 368685, 368686, 368687, 368688, 368689, 368690, 368691, 368692, 368659, 368660, 368661, 368662, 368663, 368664, 368665, 368671, 368681, 368682, 368651, 368652, 368652, 368653, 368653, 368654, 368655, 368656, 368657, 368658, 368646, 368647, 368647, 368648, 368648, 368649, 368649, 368650, 368650, 368651, 368641, 368642, 368642, 368643, 368643, 368644, 368644, 368645, 368645, 368646, 368633, 368634, 368635, 368636, 368637, 368638, 368639, 368640, 368640, 368641, 368621, 368624, 368625, 368626, 368627, 368628, 368629, 368630, 368631, 368632, 368611, 368612, 368613, 368614, 368615, 368616, 368617, 368618, 368619, 368620, 368601, 368602, 368603, 368604, 368605, 368606, 368607, 368608, 368609, 368610, 368590, 368591, 368592, 368593, 368594, 368595, 368596, 368597, 368599, 368600) union select [DST_test].[dbo].[fundamental].[fundamental_id] from [DST_test].[dbo].[fundamental] where [DST_test].[dbo].[fundamental].[fundamental_id] in (368566, 368567, 368568, 368569, 368575, 368585, 368586, 368587, 368588, 368589, 368557, 368557, 368558, 368559, 368560, 368561, 368562, 368563, 368564, 368565, 368552, 368552, 368553, 368553, 368554, 368554, 368555, 368555, 368556, 368556, 368547, 368547, 368548, 368548, 368549, 368549, 368550, 368550, 368551, 368551, 368540, 368541, 368542, 368543, 368544, 368544, 368545, 368545, 368546, 368546, 368530, 368531, 368532, 368533, 368534, 368535, 368536, 368537, 368538, 368539, 368518, 368519, 368520, 368521, 368522, 368523, 368524, 368525, 368528, 368529, 368508, 368509, 368510, 368511, 368512, 368513, 368514, 368515, 368516, 368517, 368497, 368498, 368499, 368500, 368501, 368503, 368504, 368505, 368506, 368507, 368473, 368479, 368489, 368490, 368491, 368492, 368493, 368494, 368495, 368496, 368463, 368464, 368465, 368466, 368467, 368468, 368469, 368470, 368471, 368472, 368457, 368458, 368458, 368459, 368459, 368460, 368460, 368461, 368461, 368462, 368452, 368453, 368453, 368454, 368454, 368455, 368455, 368456, 368456, 368457, 368447, 368448, 368448, 368449, 368449, 368450, 368450, 368451, 368451, 368452, 368437, 368438, 368439, 368440, 368441, 368442, 368443, 368444, 368445, 368446, 368425, 368426, 368427, 368428, 368429, 368432, 368433, 368434, 368435, 368436, 368415, 368416, 368417, 368418, 368419, 368420, 368421, 368422, 368423, 368424, 368404, 368405, 368407, 368408, 368409, 368410, 368411, 368412, 368413, 368414, 368394, 368395, 368396, 368397, 368398, 368399, 368400, 368401, 368402, 368403, 368370, 368371, 368372, 368373, 368374, 368375, 368376, 368377, 368383, 368393, 368363, 368363, 368364, 368364, 368365, 368365, 368366, 368367, 368368, 368369, 368358, 368358, 368359, 368359, 368360, 368360, 368361, 368361, 368362, 368362, 368353, 368353, 368354, 368354, 368355, 368355, 368356, 368356, 368357, 368357, 368344, 368345, 368346, 368347, 368348, 368349, 368350, 368351, 368352, 368352, 368332, 368333, 368336, 368337, 368338, 368339, 368340, 368341, 368342, 368343, 368322, 368323, 368324, 368325, 368326, 368327, 368328, 368329, 368330, 368331, 368312, 368313, 368314, 368315, 368316, 368317, 368318, 368319, 368320, 368321, 368301, 368302, 368303, 368304, 368305, 368306, 368307, 368308, 368309, 368311, 368277, 368278, 368279, 368280, 368281, 368287, 368297, 368298, 368299, 368300, 368268, 368269, 368269, 368270, 368271, 368272, 368273, 368274, 368275, 368276) union select [DST_test].[dbo].[fundamental].[fundamental_id] from [DST_test].[dbo].[fundamental] where [DST_test].[dbo].[fundamental].[fundamental_id] in (368263, 368264, 368264, 368265, 368265, 368266, 368266, 368267, 368267, 368268, 368258, 368259, 368259, 368260, 368260, 368261, 368261, 368262, 368262, 368263, 368251, 368252, 368253, 368254, 368255, 368256, 368256, 368257, 368257, 368258, 368241, 368242, 368243, 368244, 368245, 368246, 368247, 368248, 368249, 368250, 368229, 368230, 368231, 368232, 368233, 368234, 368235, 368236, 368237, 368240, 368219, 368220, 368221, 368222, 368223, 368224, 368225, 368226, 368227, 368228, 368208, 368209, 368210, 368211, 368212, 368213, 368215, 368216, 368217, 368218, 368184, 368185, 368191, 368201, 368202, 368203, 368204, 368205, 368206, 368207, 368174, 368175, 368176, 368177, 368178, 368179, 368180, 368181, 368182, 368183, 368169, 368169, 368170, 368170, 368171, 368171, 368172, 368172, 368173, 368173, 368164, 368164, 368165, 368165, 368166, 368166, 368167, 368167, 368168, 368168, 368158, 368159, 368160, 368160, 368161, 368161, 368162, 368162, 368163, 368163, 368148, 368149, 368150, 368151, 368152, 368153, 368154, 368155, 368156, 368157, 368136, 368137, 368138, 368139, 368140, 368141, 368144, 368145, 368146, 368147, 368126, 368127, 368128, 368129, 368130, 368131, 368132, 368133, 368134, 368135, 368115, 368116, 368117, 368119, 368120, 368121, 368122, 368123, 368124, 368125, 368105, 368106, 368107, 368108, 368109, 368110, 368111, 368112, 368113, 368114, 368081, 368082, 368083, 368084, 368085, 368086, 368087, 368088, 368089, 368095, 368074, 368075, 368075, 368076, 368076, 368077, 368077, 368078, 368079, 368080, 368069, 368070, 368070, 368071, 368071, 368072, 368072, 368073, 368073, 368074, 368064, 368065, 368065, 368066, 368066, 368067, 368067, 368068, 368068, 368069, 368055, 368056, 368057, 368058, 368059, 368060, 368061, 368062, 368063, 368064, 368043, 368044, 368045, 368048, 368049, 368050, 368051, 368052, 368053, 368054, 368033, 368034, 368035, 368036, 368037, 368038, 368039, 368040, 368041, 368042, 368023, 368024, 368025, 368026, 368027, 368028, 368029, 368030, 368031, 368032, 368012, 368013, 368014, 368015, 368016, 368017, 368018, 368019, 368020, 368021, 367988, 367989, 367990, 367991, 367992, 367993, 367999, 368009, 368010, 368011, 367980, 367980, 367981, 367981, 367982, 367983, 367984, 367985, 367986, 367987, 367975, 367975, 367976, 367976, 367977, 367977, 367978, 367978, 367979, 367979, 367970, 367970, 367971, 367971, 367972, 367972, 367973, 367973, 367974, 367974) union select [DST_test].[dbo].[fundamental].[fundamental_id] from [DST_test].[dbo].[fundamental] where [DST_test].[dbo].[fundamental].[fundamental_id] in (367962, 367963, 367964, 367965, 367966, 367967, 367968, 367968, 367969, 367969, 367952, 367953, 367954, 367955, 367956, 367957, 367958, 367959, 367960, 367961, 367940, 367941, 367942, 367943, 367944, 367945, 367946, 367947, 367948, 367949, 367930, 367931, 367932, 367933, 367934, 367935, 367936, 367937, 367938, 367939, 367919, 367920, 367921, 367922, 367923, 367924, 367925, 367927, 367928, 367929, 367895, 367896, 367897, 367903, 367913, 367914, 367915, 367916, 367917, 367918, 367885, 367886, 367887, 367888, 367889, 367890, 367891, 367892, 367893, 367894, 367880, 367881, 367881, 367882, 367882, 367883, 367883, 367884, 367884, 367885, 367875, 367876, 367876, 367877, 367877, 367878, 367878, 367879, 367879, 367880, 367869, 367870, 367871, 367872, 367872, 367873, 367873, 367874, 367874, 367875, 367859, 367860, 367861, 367862, 367863, 367864, 367865, 367866, 367867, 367868, 367847, 367848, 367849, 367850, 367851, 367852, 367853, 367856, 367857, 367858, 367837, 367838, 367839, 367840, 367841, 367842, 367843, 367844, 367845, 367846, 367826, 367827, 367828, 367829, 367831, 367832, 367833, 367834, 367835, 367836, 367807, 367817, 367818, 367819, 367820, 367821, 367822, 367823, 367824, 367825, 367792, 367793, 367794, 367795, 367796, 367797, 367798, 367799, 367800, 367801, 367786, 367786, 367787, 367787, 367788, 367788, 367789, 367789, 367790, 367791, 367781, 367781, 367782, 367782, 367783, 367783, 367784, 367784, 367785, 367785, 367776, 367776, 367777, 367777, 367778, 367778, 367779, 367779, 367780, 367780, 367766, 367767, 367768, 367769, 367770, 367771, 367772, 367773, 367774, 367775, 367754, 367755, 367756, 367757, 367760, 367761, 367762, 367763, 367764, 367765, 367744, 367745, 367746, 367747, 367748, 367749, 367750, 367751, 367752, 367753, 367733, 367735, 367736, 367737, 367738, 367739, 367740, 367741, 367742, 367743, 367723, 367724, 367725, 367726, 367727, 367728, 367729, 367730, 367731, 367732, 367699, 367700, 367701, 367702, 367703, 367704, 367705, 367711, 367721, 367722, 367691, 367692, 367692, 367693, 367693, 367694, 367695, 367696, 367697, 367698, 367686, 367687, 367687, 367688, 367688, 367689, 367689, 367690, 367690, 367691, 367681, 367682, 367682, 367683, 367683, 367684, 367684, 367685, 367685, 367686, 367673, 367674, 367675, 367676, 367677, 367678, 367679, 367680, 367680, 367681, 367661, 367664, 367665, 367666, 367667, 367668, 367669, 367670, 367671, 367672) union select [DST_test].[dbo].[fundamental].[fundamental_id] from [DST_test].[dbo].[fundamental] where [DST_test].[dbo].[fundamental].[fundamental_id] in (367651, 367652, 367653, 367654, 367655, 367656, 367657, 367658, 367659, 367660, 367641, 367642, 367643, 367644, 367645, 367646, 367647, 367648, 367649, 367650, 367630, 367631, 367632, 367633, 367634, 367635, 367636, 367637, 367639, 367640, 367606, 367607, 367608, 367609, 367615, 367625, 367626, 367627, 367628, 367629, 367597, 367597, 367598, 367599, 367600, 367601, 367602, 367603, 367604, 367605, 367592, 367592, 367593, 367593, 367594, 367594, 367595, 367595, 367596, 367596, 367587, 367587, 367588, 367588, 367589, 367589, 367590, 367590, 367591, 367591, 367580, 367581, 367582, 367583, 367584, 367584, 367585, 367585, 367586, 367586, 367570, 367571, 367572, 367573, 367574, 367575, 367576, 367577, 367578, 367579, 367558, 367559, 367560, 367561, 367562, 367563, 367564, 367565, 367568, 367569, 367548, 367549, 367550, 367551, 367552, 367553, 367554, 367555, 367556, 367557, 367537, 367538, 367539, 367540, 367541, 367543, 367544, 367545, 367546, 367547, 367513, 367519, 367529, 367530, 367531, 367532, 367533, 367534, 367535, 367536, 367503, 367504, 367505, 367506, 367507, 367508, 367509, 367510, 367511, 367512, 367497, 367498, 367498, 367499, 367499, 367500, 367500, 367501, 367501, 367502, 367492, 367493, 367493, 367494, 367494, 367495, 367495, 367496, 367496, 367497, 367487, 367488, 367488, 367489, 367489, 367490, 367490, 367491, 367491, 367492, 367477, 367478, 367479, 367480, 367481, 367482, 367483, 367484, 367485, 367486, 367465, 367466, 367467, 367468, 367469, 367472, 367473, 367474, 367475, 367476, 367455, 367456, 367457, 367458, 367459, 367460, 367461, 367462, 367463, 367464, 367444, 367445, 367447, 367448, 367449, 367450, 367451, 367452, 367453, 367454, 367434, 367435, 367436, 367437, 367438, 367439, 367440, 367441, 367442, 367443, 367410, 367411, 367412, 367413, 367414, 367415, 367416, 367417, 367423, 367433, 367403, 367403, 367404, 367404, 367405, 367405, 367406, 367407, 367408, 367409, 367398, 367398, 367399, 367399, 367400, 367400, 367401, 367401, 367402, 367402, 367393, 367393, 367394, 367394, 367395, 367395, 367396, 367396, 367397, 367397, 367384, 367385, 367386, 367387, 367388, 367389, 367390, 367391, 367392, 367392, 367372, 367373, 367376, 367377, 367378, 367379, 367380, 367381, 367382, 367383, 367362, 367363, 367364, 367365, 367366, 367367, 367368, 367369, 367370, 367371, 367352, 367353, 367354, 367355, 367356, 367357, 367358, 367359, 367360, 367361) union select [DST_test].[dbo].[fundamental].[fundamental_id] from [DST_test].[dbo].[fundamental] where [DST_test].[dbo].[fundamental].[fundamental_id] in (367341, 367342, 367343, 367344, 367345, 367346, 367347, 367348, 367349, 367351, 367317, 367318, 367319, 367320, 367321, 367327, 367337, 367338, 367339, 367340, 367308, 367309, 367309, 367310, 367311, 367312, 367313, 367314, 367315, 367316, 367303, 367304, 367304, 367305, 367305, 367306, 367306, 367307, 367307, 367308, 367298, 367299, 367299, 367300, 367300, 367301, 367301, 367302, 367302, 367303, 367291, 367292, 367293, 367294, 367295, 367296, 367296, 367297, 367297, 367298, 367281, 367282, 367283, 367284, 367285, 367286, 367287, 367288, 367289, 367290, 367269, 367270, 367271, 367272, 367273, 367274, 367275, 367276, 367277, 367280, 367259, 367260, 367261, 367262, 367263, 367264, 367265, 367266, 367267, 367268, 367248, 367249, 367250, 367251, 367252, 367253, 367255, 367256, 367257, 367258, 367224, 367225, 367231, 367241, 367242, 367243, 367244, 367245, 367246, 367247, 367214, 367215, 367216, 367217, 367218, 367219, 367220, 367221, 367222, 367223, 367209, 367209, 367210, 367210, 367211, 367211, 367212, 367212, 367213, 367213, 367204, 367204, 367205, 367205, 367206, 367206, 367207, 367207, 367208, 367208, 367198, 367199, 367200, 367200, 367201, 367201, 367202, 367202, 367203, 367203, 367188, 367189, 367190, 367191, 367192, 367193, 367194, 367195, 367196, 367197, 367176, 367177, 367178, 367179, 367180, 367181, 367184, 367185, 367186, 367187, 367166, 367167, 367168, 367169, 367170, 367171, 367172, 367173, 367174, 367175, 367155, 367156, 367157, 367159, 367160, 367161, 367162, 367163, 367164, 367165, 367145, 367146, 367147, 367148, 367149, 367150, 367151, 367152, 367153, 367154, 367121, 367122, 367123, 367124, 367125, 367126, 367127, 367128, 367129, 367135, 367114, 367115, 367115, 367116, 367116, 367117, 367117, 367118, 367119, 367120, 367109, 367110, 367110, 367111, 367111, 367112, 367112, 367113, 367113, 367114, 367104, 367105, 367105, 367106, 367106, 367107, 367107, 367108, 367108, 367109, 367095, 367096, 367097, 367098, 367099, 367100, 367101, 367102, 367103, 367104, 367083, 367084, 367085, 367088, 367089, 367090, 367091, 367092, 367093, 367094, 367073, 367074, 367075, 367076, 367077, 367078, 367079, 367080, 367081, 367082, 367063, 367064, 367065, 367066, 367067, 367068, 367069, 367070, 367071, 367072, 367052, 367053, 367054, 367055, 367056, 367057, 367058, 367059, 367060, 367061, 367028, 367029, 367030, 367031, 367032, 367033, 367039, 367049, 367050, 367051) union select [DST_test].[dbo].[fundamental].[fundamental_id] from [DST_test].[dbo].[fundamental] where [DST_test].[dbo].[fundamental].[fundamental_id] in (367020, 367020, 367021, 367021, 367022, 367023, 367024, 367025, 367026, 367027, 367015, 367015, 367016, 367016, 367017, 367017, 367018, 367018, 367019, 367019, 367010, 367010, 367011, 367011, 367012, 367012, 367013, 367013, 367014, 367014, 367002, 367003, 367004, 367005, 367006, 367007, 367008, 367008, 367009, 367009, 366992, 366993, 366994, 366995, 366996, 366997, 366998, 366999, 367000, 367001, 366980, 366981, 366982, 366983, 366984, 366985, 366986, 366987, 366988, 366989, 366970, 366971, 366972, 366973, 366974, 366975, 366976, 366977, 366978, 366979, 366959, 366960, 366961, 366962, 366963, 366964, 366965, 366967, 366968, 366969, 366935, 366936, 366937, 366943, 366953, 366954, 366955, 366956, 366957, 366958, 366925, 366926, 366927, 366928, 366929, 366930, 366931, 366932, 366933, 366934, 366920, 366921, 366921, 366922, 366922, 366923, 366923, 366924, 366924, 366925, 366915, 366916, 366916, 366917, 366917, 366918, 366918, 366919, 366919, 366920, 366909, 366910, 366911, 366912, 366912, 366913, 366913, 366914, 366914, 366915, 366899, 366900, 366901, 366902, 366903, 366904, 366905, 366906, 366907, 366908, 366887, 366888, 366889, 366890, 366891, 366892, 366893, 366896, 366897, 366898, 366877, 366878, 366879, 366880, 366881, 366882, 366883, 366884, 366885, 366886, 366866, 366867, 366868, 366869, 366871, 366872, 366873, 366874, 366875, 366876, 366847, 366857, 366858, 366859, 366860, 366861, 366862, 366863, 366864, 366865, 366832, 366833, 366834, 366835, 366836, 366837, 366838, 366839, 366840, 366841, 366826, 366826, 366827, 366827, 366828, 366828, 366829, 366829, 366830, 366831, 366821, 366821, 366822, 366822, 366823, 366823, 366824, 366824, 366825, 366825, 366816, 366816, 366817, 366817, 366818, 366818, 366819, 366819, 366820, 366820, 366806, 366807, 366808, 366809, 366810, 366811, 366812, 366813, 366814, 366815, 366794, 366795, 366796, 366797, 366800, 366801, 366802, 366803, 366804, 366805, 366784, 366785, 366786, 366787, 366788, 366789, 366790, 366791, 366792, 366793, 366773, 366775, 366776, 366777, 366778, 366779, 366780, 366781, 366782, 366783, 366763, 366764, 366765, 366766, 366767, 366768, 366769, 366770, 366771, 366772, 366739, 366740, 366741, 366742, 366743, 366744, 366745, 366751, 366761, 366762, 366731, 366732, 366732, 366733, 366733, 366734, 366735, 366736, 366737, 366738, 366726, 366727, 366727, 366728, 366728, 366729, 366729, 366730, 366730, 366731) union select [DST_test].[dbo].[fundamental].[fundamental_id] from [DST_test].[dbo].[fundamental] where [DST_test].[dbo].[fundamental].[fundamental_id] in (366721, 366722, 366722, 366723, 366723, 366724, 366724, 366725, 366725, 366726, 366713, 366714, 366715, 366716, 366717, 366718, 366719, 366720, 366720, 366721, 366694, 366704, 366705, 366706, 366707, 366708, 366709, 366710, 366711, 366712, 366363, 366364, 366365, 366366, 366374, 366375, 366656, 366657, 366665, 366668, 366353, 366354, 366355, 366356, 366357, 366358, 366359, 366360, 366361, 366362, 366343, 366344, 366345, 366346, 366347, 366348, 366349, 366350, 366351, 366352, 366131, 366132, 366133, 366134, 366135, 366136, 366137, 366138, 366138, 366139, 366121, 366122, 366123, 366124, 366125, 366126, 366127, 366128, 366129, 366130, 366111, 366112, 366113, 366114, 366115, 366116, 366117, 366118, 366119, 366120, 365744, 365745, 365746, 365747, 365748, 365749, 365750, 366108, 366109, 366110, 365607, 365608, 365609, 365616, 365617, 365624, 365625, 365741, 365742, 365743, 365482, 365483, 365484, 365485, 365486, 365491, 365492, 365493, 365494, 365606, 364441, 365243, 365244, 365475, 365476, 365477, 365478, 365479, 365480, 365481, 363027, 363028, 363048, 363049, 363072, 363073, 363364, 363365, 363371, 363372, 362933, 362934, 362951, 362952, 362969, 362970, 362987, 362988, 363005, 363006, 362838, 362839, 362862, 362863, 362879, 362880, 362897, 362898, 362915, 362916, 362722, 362723, 362744, 362745, 362766, 362767, 362790, 362791, 362814, 362815, 362624, 362625, 362642, 362643, 362660, 362661, 362678, 362679, 362700, 362701, 362526, 362527, 362546, 362547, 362566, 362567, 362586, 362587, 362606, 362607, 362426, 362427, 362446, 362447, 362466, 362467, 362486, 362487, 362506, 362507, 362334, 362335, 362350, 362351, 362366, 362367, 362386, 362387, 362406, 362407, 362248, 362249, 362266, 362267, 362284, 362285, 362302, 362303, 362318, 362319, 362214, 362215, 362218, 362219, 362222, 362223, 362226, 362227, 362230, 362231, 362174, 362175, 362188, 362189, 362202, 362203, 362206, 362207, 362210, 362211, 362096, 362097, 362112, 362113, 362128, 362129, 362144, 362145, 362160, 362161, 362014, 362015, 362032, 362033, 362048, 362049, 362064, 362065, 362080, 362081, 361940, 361941, 361956, 361957, 361972, 361973, 361986, 361987, 362000, 362001, 361858, 361859, 361874, 361875, 361890, 361891, 361908, 361909, 361924, 361925, 361776, 361777, 361792, 361793, 361808, 361809, 361824, 361825, 361842, 361843, 361502, 361509, 361594, 361606, 361730, 361731, 361732, 361740, 361758, 361759) union select [DST_test].[dbo].[fundamental].[fundamental_id] from [DST_test].[dbo].[fundamental] where [DST_test].[dbo].[fundamental].[fundamental_id] in (361043, 361044, 361087, 361088, 361089, 361090, 361091, 361092, 361165, 361166, 360991, 360992, 360993, 360994, 360995, 360996, 361039, 361040, 361041, 361042, 360891, 360892, 360893, 360894, 360937, 360938, 360939, 360940, 360941, 360942, 360797, 360798, 360853, 360854, 360855, 360856, 360857, 360858, 360889, 360890, 360639, 360647, 360665, 360666, 360675, 360699, 360793, 360794, 360795, 360796, 360629, 360630, 360631, 360632, 360633, 360634, 360635, 360636, 360637, 360638, 360615, 360616, 360617, 360618, 360619, 360620, 360625, 360626, 360627, 360628, 360605, 360606, 360607, 360608, 360609, 360610, 360611, 360612, 360613, 360614, 360575, 360576, 360577, 360584, 360585, 360586, 360587, 360588, 360589, 360590, 360565, 360566, 360567, 360568, 360569, 360570, 360571, 360572, 360573, 360574, 360555, 360556, 360557, 360558, 360559, 360560, 360561, 360562, 360563, 360564, 360088, 360448, 360449, 360538, 360539, 360540, 360551, 360552, 360553, 360554, 360078, 360079, 360080, 360081, 360082, 360083, 360084, 360085, 360086, 360087, 360048, 360049, 360056, 360057, 360058, 360059, 360060, 360061, 360062, 360077, 360038, 360039, 360040, 360041, 360042, 360043, 360044, 360045, 360046, 360047, 360028, 360029, 360030, 360031, 360032, 360033, 360034, 360035, 360036, 360037, 359920, 359921, 360010, 360011, 360012, 360023, 360024, 360025, 360026, 360027, 359489, 359490, 359491, 359492, 359556, 359561, 359562, 359563, 359564, 359576, 359396, 359397, 359398, 359399, 359400, 359427, 359428, 359429, 359430, 359459, 359222, 359255, 359256, 359257, 359258, 359336, 359337, 359338, 359339, 359355, 359114, 359139, 359184, 359185, 359186, 359187, 359195, 359219, 359220, 359221, 359004, 359016, 359017, 359018, 359090, 359093, 359094, 359095, 359111, 359113, 358934, 358939, 358940, 358941, 358951, 358973, 358974, 358975, 358982, 358987, 358693, 358694, 358853, 358854, 358855, 358864, 358871, 358872, 358899, 358900, 358683, 358684, 358685, 358686, 358687, 358688, 358689, 358690, 358691, 358692, 358673, 358674, 358675, 358676, 358677, 358678, 358679, 358680, 358681, 358682, 358663, 358664, 358665, 358666, 358667, 358668, 358669, 358670, 358671, 358672, 358653, 358654, 358655, 358656, 358657, 358658, 358659, 358660, 358661, 358662, 358643, 358644, 358645, 358646, 358647, 358648, 358649, 358650, 358651, 358652, 358368, 358369, 358370, 358371, 358372, 358373, 358374, 358375, 358376, 358642)
And a more. I have no idea what to do.
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-02-05 : 10:35:41
Why you are hard-coding all those IDs? Is there not a criteria which will fetch those IDs from the table?

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

vladicaognjanovic
Starting Member

26 Posts

Posted - 2007-02-05 : 10:37:40
No those id are produced by bussines logic.
I know that that is a bad arhitecture but, I didn'n wrote it, I just need to make it faster. I hope that you understand.
Go to Top of Page

vladicaognjanovic
Starting Member

26 Posts

Posted - 2007-02-05 : 10:43:13
Litle more infos, results from this select statement are stored into temp table(for example) and we use that temp table for join with others. But this select is costing us 12s-16s.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-02-05 : 11:07:06
I would do:

DECLARE @TempTable
(
T_fundamental_id int NOT NULL,
PRIMARY KEY -- The Primary Key IS important!
(
T_fundamental_id
)
)

INSERT INTO @TempTable(T_fundamental_id)
... some list of numbers ...

and then I would do

select [DST_test].[dbo].[fundamental].[fundamental_id]
from [DST_test].[dbo].[fundamental]
JOIN @TempTable
ON T_fundamental_id = [DST_test].[dbo].[fundamental].[fundamental_id]


How are you getting the list of IDs from your application?

If you provide them in a comma delimited list you should be able to use a very efficient SPLIT function to JOIN the Comma Delimited List to your table (instead of the @TempTable in my example)

See: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=CSV,Splitting%20delimited%20lists,Best%20split%20functions

Kristen
Go to Top of Page

vladicaognjanovic
Starting Member

26 Posts

Posted - 2007-02-05 : 11:16:01
We have a logic that monitors table [DST_test].[dbo].[fundamental], and track all changes (in other words gets ids of row that has
change), then we do something, in our bussines logic, with those ids and than we use IDS for filtering. But for filtering we need this ids in database. This is the only way, we know, to push this ids into temp table (or in yuor case table variable).
Go to Top of Page

vladicaognjanovic
Starting Member

26 Posts

Posted - 2007-02-05 : 11:17:16
I hope you understand. Just to say: thanks for help, because we don't know what should we do.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-02-05 : 11:54:56
"This is the only way, we know, to push this ids into temp table"

Well, I understand, in outline, what you are doing.

But how do you get the IDs that have changed? Can I see the SQL for that bit?

Once you have copied the IDs into a temporary table then just joining it (as per the examples above) should be fast. You must make SURE that you have a Primary key in your temporary table (with a large number of records that will definitely help!)

Kristen
Go to Top of Page

vladicaognjanovic
Starting Member

26 Posts

Posted - 2007-02-05 : 12:00:01
I agree, but tracking changes in fundamental table is not our job we just get them (I mean ids), and there is nothing we can do about that. This is where our problem begins. We need to "push" these id into database so we couls we could do filtering.
Go to Top of Page

vladicaognjanovic
Starting Member

26 Posts

Posted - 2007-02-05 : 12:01:14
Sorry for "we couls we could" it should be "we could"
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-02-05 : 12:15:36
"we just get them (I mean ids)"

Yes but HOW are you getting them?

From your application?

From some SQL query against the original table?

Something else??

Kristen
Go to Top of Page

vladicaognjanovic
Starting Member

26 Posts

Posted - 2007-02-05 : 12:26:23
No, some servis read ids from some index files that are on file system on some server.
Go to Top of Page

vladicaognjanovic
Starting Member

26 Posts

Posted - 2007-02-05 : 12:37:55
:(
Go to Top of Page

vladicaognjanovic
Starting Member

26 Posts

Posted - 2007-02-05 : 13:59:05
I even tryed something like this, and its still to slow:

(select 17172 as id
union select 17173
union select 17174
union select 17176
union select 17178
union select 17179
union select 17180
union select 17182
union select 17184
union select 17185
union select 17186
union select 17188
union select 17190
union select 17191
union select 17192
union select 17194
union select 17196
union select 17197
union select 17198
union select 17200
union select 17202
...
) as A
Go to Top of Page
    Next Page

- Advertisement -