Skip to content

Instantly share code, notes, and snippets.

@ghing
Created July 18, 2011 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghing/1090009 to your computer and use it in GitHub Desktop.
Save ghing/1090009 to your computer and use it in GitHub Desktop.
test query
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Aggregate (cost=24844.60..24844.61 rows=1 width=6) (actual time=1512.788..1512.788 rows=1 loops=1)
-> Bitmap Heap Scan on redistricting_characteristic (cost=12275.05..24837.62 rows=2792 width=6) (actual time=1379.484..1512.416 rows=796 loops=1)
Recheck Cond: ((geounit_id = ANY ('{366052,366059,366063,366051,366061,366066,366054,366065,366048,366049,366067,149868,149859,149858,149857,149864,149880,149877,149878,149882,149887,149889,149890,149995,149999,149998,150032,150037,150079,150082,150088,150089,150087,150141,150147,150382,150242,150249,150255,150258,150259,150302,150312,150369,150364,150363,150368,150361,150359,150379,150378,150381,150380,150384,150410,150412,150436,150433,150444,150442,150443,150508,150510,150503,150511,150542,150562,150563,150904,150568,150586,150626,150907,150649,150648,150655,150660,150670,150668,150721,150722,150687,150710,150723,150724,150714,150725,150908,150777,150783,150791,150797,150798,150830,150828,150829,150832,150837,150839,150846,150903,150899,150909,150921,151268,151013,151023,151037,151040,151045,151088,151094,151098,151122,151126,151139,151133,151138,151156,151164,151178,151179,151182,151177,151217,151231,151232,151241,151246,151284,151293,151289,151297,151312,151331,151374,151436,151425,151424,151423,151438,151445,151448,151449,151463,151479,151497,151015,150408,151017,150787,151218,150446,151022,151220,151016,150200,151029,151028,151216,150445,151295,151296,150036,151026,150666,151221,151018,151021,150404,151024,150204,150406,150669,150035,150790,151219,151019,150788,150786,150792,150405,150447,151025,150407,150671,150203,151020,150667,150201,151027,151030,150789,151033,151225,150449,150674,150679,150042,150041,150208,151228,151308,151301,150040,151300,150794,150676,150094,151222,150211,151309,151036,151305,150677,150673,151304,151307,150795,151224,150045,150043,150680,150210,150678,151227,150095,150451,151031,151302,150044,150796,151035,151034,150675,151226,150209,151303,150205,151223,151032,150793,151306,150682,150039,150096,150448,151299,150672,151298,150450,150207,150206,150683,150938,150941,149948,151208,150939,150467,150432,151209,150469,150684,149949,149950,150477,150803,150644,150778,150468,150227,150470,150233,150230,151292,149951,150940,151290,150229,151291,150685,150645,150228,150942,150232,150473,150806,150471,151334,150801,150475,149996,151332,149994,150804,150472,150802,150476,150807,151333,149997,150686,151465,151464,150002,150001,151466,150488,150012,150700,150281,150049,150490,150047,151467,150946,151339,150693,150692,150004,150280,151337,150690,150013,150819,150274,150000,150276,150944,150958,149909,150695,150275,151347,150005,151346,150486,150482,151475,150810,150814,150817,150952,150003,150046,150283,150277,151014,151009,150198,150620,151400,149993,151213,151008,149992,150619,150403,151399,150194,151401,151211,151212,151294,150399,151210,150196,151215,150195,150401,151214,150199,150785,151010,150030,150400,151012,150029,150784,150197,151011,150193,150031,150402,150622,150033,150621,150027,150192,150665,150028,151363,151105,151431,151083,151359,151110,150297,150495,150026,150024,150247,151102,151428,150300,151107,151081,151362,151109,150299,150497,151429,150652,151430,151082,150496,151103,151101,151427,151100,151099,150023,150493,150650,151360,151426,151106,150653,151108,151358,150494,150651,151361,151104,150298,150248,150025,151173,149855,151167,150708,151095,151116,151113,151375,151111,151371,150654,151433,151169,151170,151367,151114,150663,151092,150307,151087,150661,151376,151368,150308,150502,151086,150657,151115,150309,151119,151377,150662,150314,151172,150507,151125,150078,151174,150826,151175,151091,150357,151165,151123,151168,150504,151364,150825,151171,150306,150664,150505,150077,150501,150310,150498,151124,150076,150315,150075,150834,151132,150572,149866,150146,150842,150711,151443,149871,150712,151131,150716,151447,150080,150564,150515,150906,150838,150905,150366,150365,151439,150717,150090,150897,150560,151184,150894,150718,151441,151442,151130,150086,150085,151181,150835,149865,151176,150845,150713,151274,151191,150151,150575,150919,150920,151275,150623,150415,150416,150928,150156,150162,150154,150624,150923,150155,150752,151193,151457,150419,150759,150150,150911,150922,150418,151270,151460,149937,151276,150165,150417,150148,151450,150753,151278,150927,150627,150635,150409,150152,150164,149928,150924,150625,150163,150760,149927,150761,151196,150420,150373,151459,150424,150764,150574,150910,151496,151311,150098,151230,151310,150454,151247,150100,150104,150099,150105,150251,151495,151140,150109,150453,150452,151229,150257,150250,150459,151050,149881,150800,151490,150461,151049,150108,151137,151135,151494,150460,150463,151244,151248,150462,151489,150892,151236,150594,151319,149961,150241,149964,150893,150438,151324,151076,151160,151234,149965,151162,151326,151321,150646,151074,150592,151235,151080,151079,151320,149966,150434,150591,151157,151158,150538,150014,151322,151075,150587,150385,150597,151163,150019,151161,150440,151077,150016,150439,150598,150246,150017,150435,150018,151237,150020,150596,150245,150647,151422,151238,150441,151421,151328,150022,150015,150244,151240,151078,150595,150243,150588,150590,151159,150240,149962,150239,151327,150021,151329,151239,150383,149963,151233,150569,150896,150843,150567,150370,150084,151444,150360,150898,150093,150362,150367,150083,150573,150571,150902,150900,150844,149870,151440,150566,150091,150840,150142,149872,150570,149875,149874,150836,150092,150143,149876,150144,150565,150901,151446,150841,150145,150311,151166,150656,151437,150316,151435,150304,150073,151089,150358,150303,150506,150681,150038,150202,150034,150398,149854,151434,150070,151366,150072,150071,150069,150305,151084,150818,150701,151336,150431,150231,150474,150805,150371,150715,151112,151090,149869,150561,149873,150437,150593,151325,151330,150589,151323,150457,151492}'::integer[])) AND (subject_id = 38))
-> BitmapAnd (cost=12275.05..12275.05 rows=2792 width=0) (actual time=1379.290..1379.290 rows=0 loops=1)
-> Bitmap Index Scan on redistricting_characteristic_geounit_id (cost=0.00..4317.05 rows=127103 width=0) (actual time=7.902..7.902 rows=36616 loops=1)
Index Cond: (geounit_id = ANY ('{366052,366059,366063,366051,366061,366066,366054,366065,366048,366049,366067,149868,149859,149858,149857,149864,149880,149877,149878,149882,149887,149889,149890,149995,149999,149998,150032,150037,150079,150082,150088,150089,150087,150141,150147,150382,150242,150249,150255,150258,150259,150302,150312,150369,150364,150363,150368,150361,150359,150379,150378,150381,150380,150384,150410,150412,150436,150433,150444,150442,150443,150508,150510,150503,150511,150542,150562,150563,150904,150568,150586,150626,150907,150649,150648,150655,150660,150670,150668,150721,150722,150687,150710,150723,150724,150714,150725,150908,150777,150783,150791,150797,150798,150830,150828,150829,150832,150837,150839,150846,150903,150899,150909,150921,151268,151013,151023,151037,151040,151045,151088,151094,151098,151122,151126,151139,151133,151138,151156,151164,151178,151179,151182,151177,151217,151231,151232,151241,151246,151284,151293,151289,151297,151312,151331,151374,151436,151425,151424,151423,151438,151445,151448,151449,151463,151479,151497,151015,150408,151017,150787,151218,150446,151022,151220,151016,150200,151029,151028,151216,150445,151295,151296,150036,151026,150666,151221,151018,151021,150404,151024,150204,150406,150669,150035,150790,151219,151019,150788,150786,150792,150405,150447,151025,150407,150671,150203,151020,150667,150201,151027,151030,150789,151033,151225,150449,150674,150679,150042,150041,150208,151228,151308,151301,150040,151300,150794,150676,150094,151222,150211,151309,151036,151305,150677,150673,151304,151307,150795,151224,150045,150043,150680,150210,150678,151227,150095,150451,151031,151302,150044,150796,151035,151034,150675,151226,150209,151303,150205,151223,151032,150793,151306,150682,150039,150096,150448,151299,150672,151298,150450,150207,150206,150683,150938,150941,149948,151208,150939,150467,150432,151209,150469,150684,149949,149950,150477,150803,150644,150778,150468,150227,150470,150233,150230,151292,149951,150940,151290,150229,151291,150685,150645,150228,150942,150232,150473,150806,150471,151334,150801,150475,149996,151332,149994,150804,150472,150802,150476,150807,151333,149997,150686,151465,151464,150002,150001,151466,150488,150012,150700,150281,150049,150490,150047,151467,150946,151339,150693,150692,150004,150280,151337,150690,150013,150819,150274,150000,150276,150944,150958,149909,150695,150275,151347,150005,151346,150486,150482,151475,150810,150814,150817,150952,150003,150046,150283,150277,151014,151009,150198,150620,151400,149993,151213,151008,149992,150619,150403,151399,150194,151401,151211,151212,151294,150399,151210,150196,151215,150195,150401,151214,150199,150785,151010,150030,150400,151012,150029,150784,150197,151011,150193,150031,150402,150622,150033,150621,150027,150192,150665,150028,151363,151105,151431,151083,151359,151110,150297,150495,150026,150024,150247,151102,151428,150300,151107,151081,151362,151109,150299,150497,151429,150652,151430,151082,150496,151103,151101,151427,151100,151099,150023,150493,150650,151360,151426,151106,150653,151108,151358,150494,150651,151361,151104,150298,150248,150025,151173,149855,151167,150708,151095,151116,151113,151375,151111,151371,150654,151433,151169,151170,151367,151114,150663,151092,150307,151087,150661,151376,151368,150308,150502,151086,150657,151115,150309,151119,151377,150662,150314,151172,150507,151125,150078,151174,150826,151175,151091,150357,151165,151123,151168,150504,151364,150825,151171,150306,150664,150505,150077,150501,150310,150498,151124,150076,150315,150075,150834,151132,150572,149866,150146,150842,150711,151443,149871,150712,151131,150716,151447,150080,150564,150515,150906,150838,150905,150366,150365,151439,150717,150090,150897,150560,151184,150894,150718,151441,151442,151130,150086,150085,151181,150835,149865,151176,150845,150713,151274,151191,150151,150575,150919,150920,151275,150623,150415,150416,150928,150156,150162,150154,150624,150923,150155,150752,151193,151457,150419,150759,150150,150911,150922,150418,151270,151460,149937,151276,150165,150417,150148,151450,150753,151278,150927,150627,150635,150409,150152,150164,149928,150924,150625,150163,150760,149927,150761,151196,150420,150373,151459,150424,150764,150574,150910,151496,151311,150098,151230,151310,150454,151247,150100,150104,150099,150105,150251,151495,151140,150109,150453,150452,151229,150257,150250,150459,151050,149881,150800,151490,150461,151049,150108,151137,151135,151494,150460,150463,151244,151248,150462,151489,150892,151236,150594,151319,149961,150241,149964,150893,150438,151324,151076,151160,151234,149965,151162,151326,151321,150646,151074,150592,151235,151080,151079,151320,149966,150434,150591,151157,151158,150538,150014,151322,151075,150587,150385,150597,151163,150019,151161,150440,151077,150016,150439,150598,150246,150017,150435,150018,151237,150020,150596,150245,150647,151422,151238,150441,151421,151328,150022,150015,150244,151240,151078,150595,150243,150588,150590,151159,150240,149962,150239,151327,150021,151329,151239,150383,149963,151233,150569,150896,150843,150567,150370,150084,151444,150360,150898,150093,150362,150367,150083,150573,150571,150902,150900,150844,149870,151440,150566,150091,150840,150142,149872,150570,149875,149874,150836,150092,150143,149876,150144,150565,150901,151446,150841,150145,150311,151166,150656,151437,150316,151435,150304,150073,151089,150358,150303,150506,150681,150038,150202,150034,150398,149854,151434,150070,151366,150072,150071,150069,150305,151084,150818,150701,151336,150431,150231,150474,150805,150371,150715,151112,151090,149869,150561,149873,150437,150593,151325,151330,150589,151323,150457,151492}'::integer[]))
-> Bitmap Index Scan on redistricting_characteristic_subject_id (cost=0.00..7956.36 rows=371434 width=0) (actual time=1371.266..1371.266 rows=367587 loops=1)
Index Cond: (subject_id = 38)
Total runtime: 1513.009 ms
(9 rows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment