
CREATE TABLE skip_scan_test (a INTEGER, b INTEGER, c INTEGER);
CREATE INDEX abc_idx ON skip_scan_test USING btree (a, b, c);
INSERT INTO skip_scan_test (a, b, c) VALUES
	(NULL, 188, 252),
	(811, 890, 615),
	(316, 882, 761),
	(229, 973, NULL),
	(373, 672, 428),
	(679, 225, 381),
	(140, 501, 15),
	(NULL, 852, 792),
	(852, 819, 916),
	(366, 524, 54),
	(79, 704, 635),
	(967, 890, 636),
	(309, 47, 836),
	(765, 992, NULL),
	(464, 610, 841),
	(58, 398, 468),
	(585, 154, 674),
	(NULL, 752, NULL),
	(999, 304, 222),
	(82, NULL, 416),
	(402, NULL, 464),
	(922, NULL, 449),
	(275, 275, 234),
	(NULL, 728, 105),
	(57, 176, 459),
	(397, 443, 790),
	(681, 172, 48),
	(368, 965, 226),
	(860, 826, 228),
	(796, 61, 697),
	(491, NULL, 313),
	(406, 777, 507),
	(263, 604, 762),
	(8, 289, 481),
	(NULL, 164, 940),
	(612, 604, 288),
	(81, 477, NULL),
	(136, 89, NULL),
	(990, 506, 669),
	(NULL, 617, 478),
	(398, 880, 360),
	(496, 467, 783),
	(904, 643, 164),
	(61, 726, 185),
	(942, 699, 266),
	(140, 277, 26),
	(46, 109, 579),
	(NULL, 188, 674),
	(NULL, NULL, 895),
	(933, 21, 752),
	(571, 653, 384),
	(687, NULL, 881),
	(191, NULL, 572),
	(639, 173, NULL),
	(668, 385, 93),
	(996, 586, 972),
	(162, 330, NULL),
	(803, 389, 60),
	(395, 894, 325),
	(71, 784, 611),
	(120, 319, 175),
	(NULL, NULL, 807),
	(949, 635, 360),
	(NULL, 362, 208),
	(828, 702, 426),
	(NULL, 743, 711),
	(712, 192, 52),
	(787, 954, 310),
	(853, 230, 29),
	(430, 104, 127),
	(868, 793, 751),
	(338, 972, 539),
	(744, 3, 612),
	(30, 180, 73),
	(98, 768, 801),
	(937, 284, 999),
	(768, 553, 624),
	(673, 515, 491),
	(973, 149, 938),
	(786, NULL, 373),
	(830, 219, 64),
	(NULL, 894, 133),
	(588, 166, 489),
	(963, 146, NULL),
	(9, 514, 960),
	(613, 509, 131),
	(781, 610, 825),
	(812, 291, 88),
	(19, 204, 270),
	(538, NULL, NULL),
	(675, 172, 708),
	(8, 61, 196),
	(637, NULL, 52),
	(54, 988, 228),
	(NULL, 308, 481),
	(973, 584, 900),
	(606, NULL, 562),
	(405, 680, 566),
	(12, 341, 707),
	(234, 860, NULL),
	(57, 61, NULL),
	(NULL, 209, 612),
	(247, 918, 627),
	(280, 623, 487),
	(636, 306, 464),
	(661, 527, 739),
	(NULL, 15, 506),
	(NULL, 410, 458),
	(455, 869, 591),
	(71, 44, 632),
	(587, 209, 76),
	(754, 795, 175),
	(519, 945, 418),
	(332, NULL, 51),
	(NULL, 869, NULL),
	(NULL, 666, NULL),
	(615, 105, 966),
	(566, 214, 365),
	(40, NULL, 429),
	(519, 317, 244),
	(71, 707, 985),
	(440, NULL, 63),
	(825, 641, 743),
	(668, 606, 299),
	(556, 110, 85),
	(167, NULL, 582),
	(814, 692, 331),
	(NULL, 715, 545),
	(719, 580, 984),
	(480, 12, 467),
	(531, 107, 868),
	(482, 849, 622),
	(145, 757, 716),
	(887, 651, 891),
	(513, 746, 221),
	(908, 728, 522),
	(586, 70, NULL),
	(NULL, 395, 627),
	(762, 777, 797),
	(29, 527, 664),
	(540, 308, 888),
	(675, 107, 443),
	(735, 279, 429),
	(78, 937, 63),
	(540, 360, NULL),
	(65, 116, 765),
	(NULL, 195, 268),
	(588, 94, 896),
	(749, 51, 516),
	(284, 265, 752),
	(518, 526, 775),
	(423, 241, 233),
	(496, 574, 432),
	(9, 796, 69),
	(619, 355, 514),
	(NULL, 291, 225),
	(747, 878, 630),
	(122, 642, 341),
	(NULL, 698, 798),
	(560, NULL, 776),
	(366, 816, 585),
	(745, 702, 835),
	(831, NULL, 376),
	(313, 471, 230),
	(475, 409, 8),
	(679, 191, 36),
	(129, NULL, 757),
	(788, 756, 835),
	(397, 326, 213),
	(951, 277, NULL),
	(986, 652, 482),
	(153, 40, 768),
	(NULL, 629, 53),
	(618, 115, 939),
	(514, 328, 210),
	(709, 549, 730),
	(279, 381, 851),
	(703, 390, 830),
	(490, 193, 551),
	(388, NULL, 84),
	(640, 171, 892),
	(66, 502, 86),
	(51, 636, 801),
	(36, 429, 238),
	(595, NULL, 568),
	(903, 997, 944),
	(377, 919, NULL),
	(752, 368, 91),
	(793, 690, 981),
	(86, 234, NULL),
	(653, 749, 892),
	(607, 928, NULL),
	(250, 23, NULL),
	(166, 1, 278),
	(672, 144, 61),
	(926, NULL, 667),
	(351, NULL, 225),
	(117, 733, 58),
	(590, 909, 475),
	(NULL, 159, NULL),
	(422, 676, 329),
	(198, 865, 189),
	(NULL, 759, 465),
	(97, 31, 32),
	(605, 609, 772),
	(603, 348, 705),
	(678, 363, 525),
	(644, 457, 518),
	(302, 61, 937),
	(631, 839, 212),
	(NULL, 341, 826),
	(188, 709, NULL),
	(466, 370, 825),
	(108, 968, 857),
	(NULL, 448, 357),
	(178, 717, 138),
	(437, 568, 47),
	(565, 637, 336),
	(883, 826, 507),
	(48, 763, 78),
	(991, 392, 883),
	(79, 109, 91),
	(333, 798, 579),
	(511, 689, 705),
	(409, 288, 146),
	(592, 636, 756),
	(870, 633, 501),
	(490, 135, 925),
	(271, NULL, NULL),
	(125, NULL, 916),
	(668, 634, 959),
	(847, 200, 214),
	(298, 778, 377),
	(295, 603, 214),
	(719, 121, 51),
	(NULL, 698, 700),
	(835, 750, 734),
	(514, 744, 748),
	(416, 901, 583),
	(999, 691, 243),
	(215, 911, 234),
	(NULL, 999, 71),
	(912, 483, 167),
	(273, 121, 989),
	(576, 61, 629),
	(931, 587, 963),
	(NULL, 317, 0),
	(261, 46, 652),
	(273, 17, 979),
	(794, 936, 783),
	(763, NULL, 178),
	(NULL, 771, 808),
	(268, 197, 965),
	(904, 977, 247),
	(861, 651, 83),
	(NULL, 393, 91),
	(817, NULL, 946),
	(261, 773, 956),
	(867, 947, 34),
	(699, 617, 686),
	(759, 509, 847),
	(530, NULL, 980),
	(342, 111, 791),
	(132, 876, 592),
	(252, 262, 414),
	(650, 924, 407),
	(850, 44, 284),
	(675, 656, 801),
	(210, 712, 439),
	(766, 150, 457),
	(894, 856, 955),
	(171, 561, 67),
	(6, NULL, 843),
	(1, 103, 635),
	(395, 554, 2),
	(397, 314, 413),
	(NULL, 953, 522),
	(45, 979, 644),
	(423, 299, 657),
	(616, 463, 785),
	(103, 722, NULL),
	(549, 237, NULL),
	(838, 479, 967),
	(386, 534, 403),
	(25, NULL, 101),
	(231, 997, 207),
	(513, 574, 261),
	(824, 136, 398),
	(660, 361, 704),
	(620, NULL, 764),
	(NULL, 717, 792),
	(737, 848, 266),
	(880, 575, 405),
	(76, 649, 731),
	(NULL, 577, NULL),
	(425, 902, 6),
	(NULL, 907, 318),
	(NULL, 852, 135),
	(235, 543, 629),
	(863, 849, 81),
	(141, 627, 802),
	(563, 737, NULL),
	(995, 695, 52),
	(970, 396, NULL),
	(297, 853, 201),
	(914, 507, 109),
	(535, NULL, 734),
	(140, 288, NULL),
	(649, 847, NULL),
	(274, 414, 27),
	(52, 411, 634),
	(43, 529, NULL),
	(535, 235, 708),
	(881, 886, 967),
	(192, 155, 589),
	(NULL, 920, 826),
	(281, 368, 683),
	(192, NULL, 221),
	(43, NULL, 739),
	(211, 39, 229),
	(767, 397, 807),
	(41, 135, 898),
	(483, 36, 137),
	(686, 50, NULL),
	(NULL, NULL, NULL),
	(737, 209, 215),
	(701, 40, 882),
	(781, 127, 966),
	(189, 735, 776),
	(217, 478, 890),
	(300, 349, 408),
	(0, 189, 960);
ANALYZE skip_scan_test;
SELECT a, b, c
	FROM skip_scan_test
	WHERE c IS NOT DISTINCT FROM 611
	  AND c IS DISTINCT FROM 724
	  AND c <= ANY(ARRAY[908, NULL, 488, 319, 766, NULL, 946, 762, NULL, 742, NULL, 18, 527, 361, 252, 978, 174, 981, 85, NULL, 818, 91, 502, 671, 17])
	  AND a > ANY(ARRAY[96, 386, 539, 267, 205, 812, 810, 902, 221, 510, NULL, 525, 552, 681, 816, NULL, 905, 928, 136, 870, 456, 722, 774, 744, 627, 359, 675, 954, 921, NULL, 5, 488, NULL, 55, 84, 450, 16, 539, 933, 113, 469, 337, 702, 133, 910, 915, 811, 886, 802, 835, 901, 936, 453, 470, 156, 30, 779, 346, 827, 568, 768, 52, 923, 617, 272, 695, NULL, 616, 237, 607, 366, 233, 301, 987, 997, NULL, 901, 373, 714, 697, 393, 864, 146, 278, 475, 562, NULL, NULL, 458, NULL, 262, NULL, 934, 839, 390, NULL])
	  AND a IS DISTINCT FROM 248
	  AND a != ANY(ARRAY[684, 345, 45, 544, 744, 555, 550, 886, 598, 159, 609, 917, 993, 906, 61, 718, 339, 297, 46, 526, NULL, 621, 490, 325, 656, 77, NULL])
	  AND a >= 46
	  AND a > 440
	  AND a IS DISTINCT FROM 705
	  AND a != ANY(ARRAY[281, 334, 975, 641, 793])
	  AND c IS NOT DISTINCT FROM 197
	  AND c != ANY(ARRAY[683, 781, 211, 74, 90, NULL, 67, 937, 602, 958, 719, 152, 298, 923, 536, 29, 800, 709, 966, NULL, 251, 500, 353, 320, 915, 619, 757, 741, 840, 525, 162, 218, 35, 121, 504, 278])
	  AND b IS DISTINCT FROM 905
	  AND b < ANY(ARRAY[875, NULL, 694, 592, 582, 812, 404, 319, 3, 447, NULL, 227, 860, 717, 939, 381, 456, 122, 518, 705, 587, 380, 140, 978, 785, 223, 73, 903, 532, 191, 522, 918, 461, 956, 888, 98, 68, 283, 66, 649, 930, 497, NULL, 608, 276, 780, 717, 235, 816, 979, 117, NULL, 685, 626, 644, 269, 985, 74, 216, 718, 35, 634, 407, 656])
	  AND c >= ANY(ARRAY[286, 444])
	ORDER BY c DESC, a DESC, b DESC, b DESC, b DESC, c DESC, b DESC, c DESC, a DESC, c DESC;
