Skip to content

Instantly share code, notes, and snippets.

@tomatolog
Created October 1, 2014 11:02
Show Gist options
  • Select an option

  • Save tomatolog/ced09e3f2ac7626b24fc to your computer and use it in GitHub Desktop.

Select an option

Save tomatolog/ced09e3f2ac7626b24fc to your computer and use it in GitHub Desktop.
/* Tue Sep 30 23:21:37.454 2014 conn 168 real 0.981 wall 0.981 found 47390 */ SELECT * , MIN(modification_start_year) AS group_start_year, MAX(modification_end_year) AS group_end_year, MIN(price) AS group_min_price, MAX(price) AS group_max_price, COUNT(*) as group_city_count, COUNT(*) as group_all_count, ( IF(seller=4, 1, 0) - IF(seller=3, 1, 0) + IF(photo, 10, 0) + IF(state<2, 5, 0) + IF(custom<2, 5, 0) + IF(availability=1, 5, 0) + IF(warranty=1, 5, 0) + IF(section_id = 2, 10, IF(owners_number<=2, 5, 0)) + IF(year>=2009, 5, 0) - IF(is_suspect_photo, 9, 0) ) AS rank_expr , (IF(seller=4, 1, 0)) AS dealer_rank_expr, GROUP_CONCAT(id) AS ids FROM all WHERE modification_default=0 AND folder_id!=0 AND status IN (0,8,9) AND expire_date BETWEEN 1411502400 AND 2823134440 AND category_id=15 AND year BETWEEN 2008 AND 2012 AND availability=1 AND state IN (1,2,3) AND city_id IN (1123,2155) AND custom=1 GROUP BY modification_salon WITHIN GROUP ORDER BY price asc, rank_expr DESC, price ASC ORDER BY price asc, rank_expr DESC, price ASC LIMIT 0,60 OPTION max_matches=5000; /* ios=0 kb=0.0 ioms=0.0 cpums=280.6 */
/* Tue Sep 30 23:21:37.793 2014 conn 169 real 0.672 wall 0.672 found 2 */ SELECT INTERVAL(run, 1, 0, 160000, 9223372036854775807) as run_interval FROM all WHERE MATCH('@extras 22_1 30_1 31_1 ( 33_35 | 33_298 | 33_299 ) 37_1 38_1 ( 39_40 | 39_41 | 39_42 ) ( 46_48 | 46_303 ) ( 49_50 ) 52_1 59_1 67_1 73_1 204_1 205_1 207_1') AND modification_default=0 AND folder_id!=0 AND status IN (0,8,9) AND expire_date BETWEEN 1411502400 AND 2823134642 AND category_id=15 AND mark_id=170 AND price BETWEEN 150000 AND 240000 AND availability=1 AND run_interval NOT IN (1,3,4) AND state=1 AND gearbox IN (1414,1415,1416,1417,1418,1429) AND photo=1 AND engine_power BETWEEN 0 AND 200 AND city_id IN (16,21,110,128,143,156,219,226,254,313,317,319,335,343,358,400,431,468,477,481,482,489,492,502,503,536,545,547,567,574,575,584,588,609,651,659,664,683,684,729,731,782,783,806,826,835,873,904,931,1002,1009,1017,1024,1062,1087,1090,1107,1119,1123,1144,1160,1174,1265,1266,1272,1285,1291,1296,1307,1333,1336,1353,1402,1439,1447,1483,1496,1510,1519,1521,1530,1534,1539,1545,1559,1616,1621,1625,1628,1665,1721,1757,1761,1769,1778,1825,1902,1939,1955,1969,1975,1980,1983,2015,2025,2027,2060,2061,2062,2086,2095,2100,2101,2110,2156,2172,2174,2184,2187,2189,2198,2221,2357,2358,2386,2387,2388,2396,2404,2493,2494,2495,2496,2497,2498,2499,2500,2583,2584,2585,2586,2587,2588,2589,2590,2591,2624,3126,3127,3128,3140,3141,3142,3143,3144,3145,3146,3147,3148,4707,4711,4718,4724,4734,4744,4746,4806,4808,4814,4816,4842,4850,4852,4858,4866,4867,4868,4869,4870,4873,4874,4903,4907,4909,4915,4917) AND wheel=1 AND owners_number IN (0,1,2) AND custom=1 LIMIT 0,1 OPTION max_matches=1; /* ios=126 kb=9767.5 ioms=196.6 cpums=231.4 */
/* Tue Sep 30 23:21:46.397 2014 conn 164 real 0.797 wall 0.797 found 109624 */ SELECT * , MIN(modification_start_year) AS group_start_year, MAX(modification_end_year) AS group_end_year, MIN(price) AS group_min_price, MAX(price) AS group_max_price, COUNT(*) as group_city_count, COUNT(*) as group_all_count, ( IF(seller=4, 1, 0) - IF(seller=3, 1, 0) + IF(photo, 10, 0) + IF(state<2, 5, 0) + IF(custom<2, 5, 0) + IF(availability=1, 5, 0) + IF(warranty=1, 5, 0) + IF(section_id = 2, 10, IF(owners_number<=2, 5, 0)) + IF(year>=2009, 5, 0) - IF(is_suspect_photo, 9, 0) ) AS rank_expr , (IF(seller=4, 1, 0)) AS dealer_rank_expr, GROUP_CONCAT(id) AS ids FROM all WHERE modification_default=0 AND folder_id!=0 AND status IN (0,8,9) AND expire_date BETWEEN 1411502400 AND 2823133682 AND category_id=15 AND availability=1 AND state IN (1,2,3) AND city_id IN (1123,2155) AND custom=1 GROUP BY modification_salon WITHIN GROUP ORDER BY price asc, rank_expr DESC, price ASC ORDER BY price asc, rank_expr DESC, price ASC LIMIT 0,60 OPTION max_matches=5000; /* ios=0 kb=0.0 ioms=0.0 cpums=474.3 */
/* Tue Sep 30 23:21:50.642 2014 conn 171 real 0.381 wall 0.381 found 9066 */ SELECT * , MIN(modification_start_year) AS group_start_year, MAX(modification_end_year) AS group_end_year, MIN(price) AS group_min_price, MAX(price) AS group_max_price, COUNT(*) as group_city_count, COUNT(*) as group_all_count, ( IF(seller=4, 1, 0) - IF(seller=3, 1, 0) + IF(photo, 10, 0) + IF(state<2, 5, 0) + IF(custom<2, 5, 0) + IF(availability=1, 5, 0) + IF(warranty=1, 5, 0) + IF(section_id = 2, 10, IF(owners_number<=2, 5, 0)) + IF(year>=2009, 5, 0) - IF(is_suspect_photo, 9, 0) ) AS rank_expr , (IF(seller=4, 1, 0)) AS dealer_rank_expr, GROUP_CONCAT(id) AS ids FROM all WHERE modification_default=0 AND folder_id!=0 AND status IN (0,8,9) AND expire_date BETWEEN 1411502400 AND 2823135034 AND category_id=15 AND price BETWEEN 800000 AND 1250000 AND year BETWEEN 2012 AND 2014 AND availability=1 AND photo=1 AND wheel=1 AND custom=1 GROUP BY modification_salon WITHIN GROUP ORDER BY name asc, rank_expr DESC, price ASC ORDER BY name asc, rank_expr DESC, price ASC LIMIT 3600,60 OPTION max_matches=5000; /* ios=0 kb=0.0 ioms=0.0 cpums=134.1 */
/* Tue Sep 30 23:22:14.503 2014 conn 164 real 0.901 wall 0.901 found 108552 */ SELECT * , MIN(modification_start_year) AS group_start_year, MAX(modification_end_year) AS group_end_year, MIN(price) AS group_min_price, MAX(price) AS group_max_price, COUNT(*) as group_city_count, COUNT(*) as group_all_count, ( IF(seller=4, 1, 0) - IF(seller=3, 1, 0) + IF(photo, 10, 0) + IF(state<2, 5, 0) + IF(custom<2, 5, 0) + IF(availability=1, 5, 0) + IF(warranty=1, 5, 0) + IF(section_id = 2, 10, IF(owners_number<=2, 5, 0)) + IF(year>=2009, 5, 0) - IF(is_suspect_photo, 9, 0) ) AS rank_expr , (IF(seller=4, 1, 0)) AS dealer_rank_expr, GROUP_CONCAT(id) AS ids FROM all WHERE modification_default=0 AND folder_id!=0 AND status IN (0,8,9) AND expire_date BETWEEN 1411502400 AND 2823133684 AND category_id=15 AND availability=1 AND state IN (1,2,3) AND city_id=1123 AND custom=1 GROUP BY modification_salon WITHIN GROUP ORDER BY price asc, rank_expr DESC, price ASC ORDER BY price asc, rank_expr DESC, price ASC LIMIT 0,60 OPTION max_matches=5000; /* ios=0 kb=0.0 ioms=0.0 cpums=469.5 */
/* Tue Sep 30 23:22:18.966 2014 conn 168 real 0.388 wall 0.388 found 30259 */ SELECT * , MIN(modification_start_year) AS group_start_year, MAX(modification_end_year) AS group_end_year, MIN(price) AS group_min_price, MAX(price) AS group_max_price, COUNT(*) as group_city_count, COUNT(*) as group_used_count, ( IF(seller=4, 1, 0) - IF(seller=3, 1, 0) + IF(photo, 10, 0) + IF(state<2, 5, 0) + IF(custom<2, 5, 0) + IF(availability=1, 5, 0) + IF(warranty=1, 5, 0) + IF(section_id = 2, 10, IF(owners_number<=2, 5, 0)) + IF(year>=2009, 5, 0) - IF(is_suspect_photo, 9, 0) ) AS rank_expr , (IF(seller=4, 1, 0)) AS dealer_rank_expr, GROUP_CONCAT(id) AS ids FROM all WHERE modification_default=0 AND folder_id!=0 AND status IN (0,8,9) AND expire_date BETWEEN 1411502400 AND 2823134446 AND category_id=15 AND section_id=1 AND price BETWEEN 200000 AND 280000 AND year>=1997 GROUP BY modification_salon WITHIN GROUP ORDER BY price asc, rank_expr DESC, price ASC ORDER BY price asc, rank_expr DESC, price ASC LIMIT 0,60 OPTION max_matches=5000; /* ios=0 kb=0.0 ioms=0.0 cpums=234.9 */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment