Friday, March 29, 2019

[google-cloud-sql-discuss] Read from mysql.slow_log; inconsistent application of SUPER privileges

I have a 2nd Generation Mysql instance in Google Cloud SQL. I've turned on slow query logging with log_output set to TABLE and I'd like to read from that table.

When I connect to my instance remotely as root, and I run this:

    SELECT * FROM mysql.`slow_log`;

I get a beautiful set of rows, and I am happy.

When I put this query in my App Engine production code (which also connects as root) and deploy, I get this error:

    Access denied; you need (at least one of) the SUPER privilege(s) for this operation
and I am sad.

I understand that Cloud SQL doesn't support SUPER privileges. But why can I read from this table remotely, but not when deployed? Can I somehow apply the privileges I have when connecting remotely that allow this query to succeed to my deployed connection? Any other way of exporting the data in this table?

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/f85736cc-9631-4c34-a688-17e6f8640bfb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thursday, March 28, 2019

[google-cloud-sql-discuss] Maximum Read Replicas

Does anyone knows what is the limit of read replicas that cab created? Either within projector zone or region?
TIA.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/9e478204-c7f9-467c-870c-07bbe5f02aa8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Saturday, March 23, 2019

[google-cloud-sql-discuss] temporary file size exceeds temp_file_limit

"QUERY PLAN"
"Hash Left Join (cost=139.46..232.31 rows=597 width=3702) (actual time=11437.496..11438.477 rows=2 loops=1)"
" Hash Cond: (profile_mod_link.app_type_id = ""profile_mod:link:app_type"".id)"
" -> Hash Anti Join (cost=135.60..220.24 rows=597 width=2937) (actual time=11421.692..11422.671 rows=2 loops=1)"
" Hash Cond: (persona.id = ""like"".persona_2_id)"
" -> Hash Left Join (cost=134.34..210.99 rows=716 width=2937) (actual time=11418.443..11419.419 rows=2 loops=1)"
" Hash Cond: (profile.id = profile_mod.profile_id)"
" -> Hash Right Join (cost=128.96..196.53 rows=110 width=2881) (actual time=11394.279..11395.249 rows=2 loops=1)"
" Hash Cond: (profile_network.profile_id = profile.id)"
" -> Nested Loop Left Join (cost=2.90..69.41 rows=5 width=153) (actual time=11147.670..11162.367 rows=5 loops=1)"
" -> Nested Loop Left Join (cost=2.62..27.85 rows=5 width=118) (actual time=13.124..15.388 rows=5 loops=1)"
" -> Hash Right Join (cost=2.46..6.94 rows=5 width=114) (actual time=12.486..12.657 rows=5 loops=1)"
" Hash Cond: (""profile_network:school_major_type"".id = profile_network.school_major_type_id)"
" -> Seq Scan on profile_network_school_major_type ""profile_network:school_major_type"" (cost=0.00..3.77 rows=177 width=30) (actual time=1.031..1.068 rows=177 loops=1)"
" -> Hash (cost=2.40..2.40 rows=5 width=84) (actual time=6.233..6.233 rows=5 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Hash Right Join (cost=1.11..2.40 rows=5 width=84) (actual time=5.530..5.545 rows=5 loops=1)"
" Hash Cond: (""profile_network:school_degree_type"".id = profile_network.school_degree_type_id)"
" -> Seq Scan on profile_network_school_degree_type ""profile_network:school_degree_type"" (cost=0.00..1.18 rows=18 width=20) (actual time=1.471..1.475 rows=18 loops=1)"
" -> Hash (cost=1.05..1.05 rows=5 width=64) (actual time=1.403..1.403 rows=5 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_network (cost=0.00..1.05 rows=5 width=64) (actual time=0.753..0.757 rows=5 loops=1)"
" -> Index Only Scan using profile_section_pkey on profile_section ""profile_network:section"" (cost=0.15..4.17 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=5)"
" Index Cond: (id = profile_network.section_id)"
" Heap Fetches: 0"
" -> Index Scan using profile_network_school_type_pkey on profile_network_school_type ""profile_network:school_type"" (cost=0.29..8.30 rows=1 width=35) (actual time=2227.981..2229.253 rows=1 loops=5)"
" Index Cond: (id = profile_network.school_type_id)"
" -> Hash (cost=124.68..124.68 rows=110 width=2728) (actual time=224.511..224.511 rows=2 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 10kB"
" -> Hash Left Join (cost=65.52..124.68 rows=110 width=2728) (actual time=208.502..218.625 rows=2 loops=1)"
" Hash Cond: (profile_date.id = ""profile_date:looking_for_type_join"".profile_date_id)"
" -> Hash Left Join (cost=63.18..120.76 rows=94 width=2716) (actual time=195.658..205.773 rows=2 loops=1)"
" Hash Cond: (profile_date.sex_drive_type_id = ""profile_date:sex_drive_type"".id)"
" -> Hash Left Join (cost=62.07..118.83 rows=94 width=2706) (actual time=192.693..202.805 rows=2 loops=1)"
" Hash Cond: (profile_date.sex_health_type_id = ""profile_date:sex_health_type"".id)"
" -> Hash Left Join (cost=61.00..116.94 rows=94 width=2694) (actual time=188.146..198.253 rows=2 loops=1)"
" Hash Cond: (profile_date.money_habit_type_id = ""profile_date:money_habit_type"".id)"
" -> Hash Left Join (cost=59.89..115.16 rows=94 width=2671) (actual time=185.589..195.691 rows=2 loops=1)"
" Hash Cond: (profile_date.money_income_type_id = ""profile_date:money_income_type"".id)"
" -> Hash Left Join (cost=58.73..113.49 rows=94 width=2658) (actual time=184.133..194.230 rows=2 loops=1)"
" Hash Cond: (""profile_date:country_want_travel_type_join"".country_travel_type_id = ""profile_date:country_want_travel_type"".id)"
" -> Hash Left Join (cost=49.88..103.35 rows=94 width=2619) (actual time=178.390..188.480 rows=2 loops=1)"
" Hash Cond: (profile_date.id = ""profile_date:cuisine_type_join"".profile_date_id)"
" -> Hash Left Join (cost=47.24..99.24 rows=47 width=2606) (actual time=169.541..179.627 rows=2 loops=1)"
" Hash Cond: (profile_date.id = ""profile_date:activity_type_join"".profile_date_id)"
" -> Hash Left Join (cost=44.07..95.32 rows=28 width=2591) (actual time=161.791..171.871 rows=2 loops=1)"
" Hash Cond: (profile_date.id = ""profile_date:country_want_travel_type_join"".profile_date_id)"
" -> Nested Loop Left Join (cost=42.96..93.77 rows=28 width=2587) (actual time=158.986..169.062 rows=2 loops=1)"
" Join Filter: (""profile_date:country_have_travel_type_join"".profile_date_id = profile_date.id)"
" Rows Removed by Join Filter: 4"
" -> Hash Left Join (cost=41.91..85.29 rows=28 width=2544) (actual time=149.458..159.527 rows=2 loops=1)"
" Hash Cond: (profile_date.mbti_type_id = ""profile_date:mbti_type"".id)"
" -> Hash Left Join (cost=40.55..83.73 rows=28 width=2535) (actual time=146.481..156.545 rows=2 loops=1)"
" Hash Cond: (profile_date.zodiac_type_id = ""profile_date:zodiac_type"".id)"
" -> Nested Loop Left Join (cost=39.28..82.13 rows=28 width=2520) (actual time=142.372..152.431 rows=2 loops=1)"
" Join Filter: (""profile_date:have_car_type"".id = profile_date.have_car_type_id)"
" Rows Removed by Join Filter: 4"
" -> Hash Left Join (cost=39.28..80.26 rows=28 width=2513) (actual time=139.696..149.751 rows=2 loops=1)"
" Hash Cond: (profile_date.have_place_type_id = ""profile_date:have_place_type"".id)"
" -> Hash Left Join (cost=38.22..78.95 rows=28 width=2497) (actual time=136.611..146.660 rows=2 loops=1)"
" Hash Cond: (profile_date.exercise_level_type_id = ""profile_date:exercise_level_type"".id)"
" -> Hash Left Join (cost=37.13..77.61 rows=28 width=2482) (actual time=132.589..142.635 rows=2 loops=1)"
" Hash Cond: (profile_date.id = ""profile_date:love_language_type_join"".profile_date_id)"
" -> Hash Left Join (cost=34.83..74.91 rows=28 width=2462) (actual time=125.128..135.169 rows=2 loops=1)"
" Hash Cond: (profile_date.diet_type_id = ""profile_date:diet_type"".id)"
" -> Hash Left Join (cost=33.72..73.56 rows=28 width=2448) (actual time=119.175..129.210 rows=2 loops=1)"
" Hash Cond: (profile_date.drug_type_id = ""profile_date:drug_type"".id)"
" -> Hash Left Join (cost=32.65..72.24 rows=28 width=2439) (actual time=116.688..126.720 rows=2 loops=1)"
" Hash Cond: (profile_date.drink_type_id = ""profile_date:drink_type"".id)"
" -> Hash Left Join (cost=31.59..70.88 rows=28 width=2430) (actual time=113.904..123.931 rows=2 loops=1)"
" Hash Cond: (profile_date.smoke_type_id = ""profile_date:smoke_type"".id)"
" -> Hash Left Join (cost=30.50..69.50 rows=28 width=2419) (actual time=110.667..120.690 rows=2 loops=1)"
" Hash Cond: (profile_date.kid_type_id = ""profile_date:kid_type"".id)"
" -> Nested Loop Left Join (cost=29.41..68.11 rows=28 width=2399) (actual time=105.960..115.979 rows=2 loops=1)"
" Join Filter: (""profile_date:pet_type_join"".profile_date_id = profile_date.id)"
" Rows Removed by Join Filter: 4"
" -> Hash Left Join (cost=28.36..64.93 rows=28 width=2387) (actual time=100.495..110.508 rows=2 loops=1)"
" Hash Cond: (profile_date.id = ""profile_date:language_type_join"".profile_date_id)"
" -> Nested Loop Left Join (cost=24.30..60.41 rows=12 width=2375) (actual time=93.413..103.421 rows=2 loops=1)"
" Join Filter: (""profile_date:relationship_monopoly_type"".id = profile_date.relationship_monopoly_type_id)"
" Rows Removed by Join Filter: 4"
" -> Hash Left Join (cost=24.30..59.02 rows=12 width=2360) (actual time=91.681..101.683 rows=2 loops=1)"
" Hash Cond: (profile_date.relationship_status_type_id = ""profile_date:relationship_status_type"".id)"
" -> Nested Loop Left Join (cost=23.03..57.65 rows=12 width=2343) (actual time=87.583..97.580 rows=2 loops=1)"
" Join Filter: (""profile_date:politics_type"".id = profile_date.politics_type_id)"
" Rows Removed by Join Filter: 6"
" -> Hash Left Join (cost=23.03..56.07 rows=12 width=2329) (actual time=84.482..94.474 rows=2 loops=1)"
" Hash Cond: (profile_date.religion_type_id = ""profile_date:religion_type"".id)"
" -> Hash Left Join (cost=21.78..54.72 rows=12 width=2318) (actual time=81.123..91.111 rows=2 loops=1)"
" Hash Cond: (""profile_date:ethnicity_type_join"".ethnicity_type_id = ""profile_date:ethnicity_type"".id)"
" -> Hash Left Join (cost=20.58..53.35 rows=12 width=2308) (actual time=77.351..87.333 rows=2 loops=1)"
" Hash Cond: (profile_date.hair_color_type_id = ""profile_date:hair_color_type"".id)"
" -> Hash Left Join (cost=19.47..52.13 rows=12 width=2297) (actual time=74.191..84.169 rows=2 loops=1)"
" Hash Cond: (profile_date.eye_color_type_id = ""profile_date:eye_color_type"".id)"
" -> Nested Loop Left Join (cost=18.31..50.87 rows=12 width=2287) (actual time=71.066..81.039 rows=2 loops=1)"
" Join Filter: (""profile_date:body_mod_type_join"".body_mod_type_id = ""profile_date:body_mod_type"".id)"
" Rows Removed by Join Filter: 6"
" -> Nested Loop Left Join (cost=18.31..49.29 rows=12 width=2280) (actual time=69.756..79.722 rows=2 loops=1)"
" Join Filter: (""profile_date:face_feature_type_join"".profile_date_id = profile_date.id)"
" Rows Removed by Join Filter: 4"
" -> Hash Left Join (cost=17.27..46.82 rows=12 width=2269) (actual time=63.554..73.512 rows=2 loops=1)"
" Hash Cond: (profile_date.id = ""profile_date:ethnicity_type_join"".profile_date_id)"
" -> Hash Left Join (cost=16.13..45.50 rows=12 width=2265) (actual time=60.249..70.202 rows=2 loops=1)"
" Hash Cond: (profile_date.id = ""profile_date:body_mod_type_join"".profile_date_id)"
" -> Hash Left Join (cost=15.02..44.23 rows=12 width=2261) (actual time=57.474..67.422 rows=2 loops=1)"
" Hash Cond: (""profile_date:gender_type_join"".gender_type_id = ""profile_date:gender_type"".id)"
" -> Hash Left Join (cost=13.86..42.91 rows=12 width=2252) (actual time=54.428..64.369 rows=2 loops=1)"
" Hash Cond: (profile_date.id = ""profile_date:gender_type_join"".profile_date_id)"
" -> Hash Left Join (cost=12.59..41.45 rows=6 width=2248) (actual time=51.071..61.007 rows=2 loops=1)"
" Hash Cond: (profile_date.id = ""profile_date:orientation_type_join"".profile_date_id)"
" -> Nested Loop Left Join (cost=10.14..38.91 rows=6 width=2235) (actual time=43.901..53.828 rows=2 loops=1)"
" Join Filter: (""profile_date:body_type"".id = profile_date.body_type_id)"
" Rows Removed by Join Filter: 8"
" -> Nested Loop Left Join (cost=10.14..37.50 rows=6 width=2225) (actual time=41.314..51.233 rows=2 loops=1)"
" -> Hash Left Join (cost=9.99..12.40 rows=6 width=2221) (actual time=35.445..35.522 rows=2 loops=1)"
" Hash Cond: (profile.id = profile_date.profile_id)"
" Filter: (profile_date.height IS NULL)"
" Rows Removed by Filter: 28"
" -> Hash Left Join (cost=8.85..10.80 rows=34 width=2101) (actual time=32.329..32.416 rows=30 loops=1)"
" Hash Cond: (persona.id = ""persona:photo"".persona_id)"
" -> Hash Join (cost=7.47..8.96 rows=12 width=1838) (actual time=30.755..30.813 rows=12 loops=1)"
" Hash Cond: (""persona:pool_join"".pool_type_id = ""persona:pool"".id)"
" -> Hash Join (cost=6.39..7.72 rows=12 width=1213) (actual time=17.035..17.077 rows=12 loops=1)"
" Hash Cond: (""persona:pool_join"".persona_id = persona.id)"
" -> Seq Scan on pool ""persona:pool_join"" (cost=0.00..1.15 rows=15 width=8) (actual time=0.024..0.034 rows=15 loops=1)"
" -> Hash (cost=6.33..6.33 rows=5 width=1209) (actual time=14.958..14.958 rows=5 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 12kB"
" -> Hash Left Join (cost=4.85..6.33 rows=5 width=1209) (actual time=13.613..14.251 rows=5 loops=1)"
" Hash Cond: (persona.id = like_2.persona_2_id)"
" -> Hash Left Join (cost=3.57..5.01 rows=5 width=1168) (actual time=10.452..10.493 rows=5 loops=1)"
" Hash Cond: (persona.id = like_1.persona_1_id)"
" -> Hash Join (cost=2.27..3.64 rows=5 width=1127) (actual time=6.323..6.358 rows=5 loops=1)"
" Hash Cond: (persona.profile_id = profile.id)"
" -> Hash Right Join (cost=1.14..2.43 rows=6 width=329) (actual time=2.050..2.067 rows=6 loops=1)"
" Hash Cond: (photo.persona_id = persona.id)"
" -> Seq Scan on photo (cost=0.00..1.21 rows=6 width=263) (actual time=0.029..0.036 rows=6 loops=1)"
" Filter: (""position"" = 0)"
" Rows Removed by Filter: 11"
" -> Hash (cost=1.06..1.06 rows=6 width=66) (actual time=0.567..0.567 rows=6 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on persona (cost=0.00..1.06 rows=6 width=66) (actual time=0.017..0.022 rows=6 loops=1)"
" -> Hash (cost=1.07..1.07 rows=5 width=798) (actual time=3.560..3.561 rows=5 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 10kB"
" -> Seq Scan on profile (cost=0.00..1.07 rows=5 width=798) (actual time=2.474..2.479 rows=5 loops=1)"
" Filter: (id <> 5)"
" Rows Removed by Filter: 1"
" -> Hash (cost=1.25..1.25 rows=4 width=41) (actual time=2.246..2.246 rows=4 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on ""like"" like_1 (cost=0.00..1.25 rows=4 width=41) (actual time=1.639..1.645 rows=4 loops=1)"
" Filter: (persona_2_id = 5)"
" Rows Removed by Filter: 16"
" -> Hash (cost=1.25..1.25 rows=2 width=41) (actual time=1.814..1.814 rows=2 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on ""like"" like_2 (cost=0.00..1.25 rows=2 width=41) (actual time=0.777..0.782 rows=2 loops=1)"
" Filter: (persona_1_id = 1)"
" Rows Removed by Filter: 18"
" -> Hash (cost=1.04..1.04 rows=3 width=629) (actual time=13.021..13.021 rows=3 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on pool_type ""persona:pool"" (cost=0.00..1.04 rows=3 width=629) (actual time=12.061..12.073 rows=3 loops=1)"
" Filter: (id = ANY ('{1,2,3}'::integer[]))"
" -> Hash (cost=1.17..1.17 rows=17 width=263) (actual time=0.473..0.473 rows=17 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 13kB"
" -> Seq Scan on photo ""persona:photo"" (cost=0.00..1.17 rows=17 width=263) (actual time=0.018..0.021 rows=17 loops=1)"
" -> Hash (cost=1.06..1.06 rows=6 width=120) (actual time=0.699..0.700 rows=6 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date (cost=0.00..1.06 rows=6 width=120) (actual time=0.019..0.022 rows=6 loops=1)"
" -> Index Only Scan using profile_section_pkey on profile_section ""profile_date:section"" (cost=0.15..4.17 rows=1 width=4) (actual time=0.005..0.005 rows=0 loops=2)"
" Index Cond: (id = profile_date.section_id)"
" Heap Fetches: 0"
" -> Materialize (cost=0.00..1.06 rows=4 width=10) (actual time=0.697..0.699 rows=4 loops=2)"
" -> Seq Scan on profile_date_body_type ""profile_date:body_type"" (cost=0.00..1.04 rows=4 width=10) (actual time=0.024..0.025 rows=4 loops=1)"
" -> Hash (cost=2.38..2.38 rows=6 width=17) (actual time=5.316..5.316 rows=6 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Hash Right Join (cost=1.14..2.38 rows=6 width=17) (actual time=4.139..4.150 rows=6 loops=1)"
" Hash Cond: (""profile_date:orientation_type"".id = ""profile_date:orientation_type_join"".orientation_type_id)"
" -> Seq Scan on profile_date_orientation_type ""profile_date:orientation_type"" (cost=0.00..1.12 rows=12 width=13) (actual time=0.015..0.017 rows=12 loops=1)"
" -> Hash (cost=1.06..1.06 rows=6 width=8) (actual time=1.932..1.932 rows=6 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_orientation ""profile_date:orientation_type_join"" (cost=0.00..1.06 rows=6 width=8) (actual time=0.719..0.724 rows=6 loops=1)"
" -> Hash (cost=1.12..1.12 rows=12 width=8) (actual time=0.877..0.877 rows=12 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_gender ""profile_date:gender_type_join"" (cost=0.00..1.12 rows=12 width=8) (actual time=0.019..0.024 rows=12 loops=1)"
" -> Hash (cost=1.07..1.07 rows=7 width=13) (actual time=0.513..0.513 rows=7 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_gender_type ""profile_date:gender_type"" (cost=0.00..1.07 rows=7 width=13) (actual time=0.020..0.022 rows=7 loops=1)"
" -> Hash (cost=1.05..1.05 rows=5 width=8) (actual time=2.042..2.042 rows=5 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_body_mod ""profile_date:body_mod_type_join"" (cost=0.00..1.05 rows=5 width=8) (actual time=1.302..1.307 rows=5 loops=1)"
" -> Hash (cost=1.06..1.06 rows=6 width=8) (actual time=1.646..1.646 rows=6 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_ethnicity ""profile_date:ethnicity_type_join"" (cost=0.00..1.06 rows=6 width=8) (actual time=1.034..1.036 rows=6 loops=1)"
" -> Materialize (cost=1.04..2.12 rows=2 width=15) (actual time=2.827..2.830 rows=2 loops=2)"
" -> Hash Right Join (cost=1.04..2.11 rows=2 width=15) (actual time=5.078..5.083 rows=2 loops=1)"
" Hash Cond: (""profile_date:face_feature_type"".id = ""profile_date:face_feature_type_join"".face_feature_type_id)"
" -> Seq Scan on profile_date_face_feature_type ""profile_date:face_feature_type"" (cost=0.00..1.03 rows=3 width=11) (actual time=0.711..0.712 rows=3 loops=1)"
" -> Hash (cost=1.02..1.02 rows=2 width=8) (actual time=1.696..1.696 rows=2 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_face_feature ""profile_date:face_feature_type_join"" (cost=0.00..1.02 rows=2 width=8) (actual time=1.157..1.160 rows=2 loops=1)"
" -> Materialize (cost=0.00..1.04 rows=3 width=11) (actual time=0.285..0.285 rows=3 loops=2)"
" -> Seq Scan on profile_date_body_mod_type ""profile_date:body_mod_type"" (cost=0.00..1.03 rows=3 width=11) (actual time=0.013..0.014 rows=3 loops=1)"
" -> Hash (cost=1.07..1.07 rows=7 width=10) (actual time=1.048..1.048 rows=7 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_eye_color_type ""profile_date:eye_color_type"" (cost=0.00..1.07 rows=7 width=10) (actual time=0.014..0.018 rows=7 loops=1)"
" -> Hash (cost=1.05..1.05 rows=5 width=11) (actual time=0.737..0.738 rows=5 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_hair_color_type ""profile_date:hair_color_type"" (cost=0.00..1.05 rows=5 width=11) (actual time=0.015..0.018 rows=5 loops=1)"
" -> Hash (cost=1.09..1.09 rows=9 width=14) (actual time=1.417..1.417 rows=9 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_ethnicity_type ""profile_date:ethnicity_type"" (cost=0.00..1.09 rows=9 width=14) (actual time=0.018..0.023 rows=9 loops=1)"
" -> Hash (cost=1.11..1.11 rows=11 width=11) (actual time=1.113..1.113 rows=11 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_religion_type ""profile_date:religion_type"" (cost=0.00..1.11 rows=11 width=11) (actual time=0.025..0.031 rows=11 loops=1)"
" -> Materialize (cost=0.00..1.04 rows=3 width=14) (actual time=0.589..0.592 rows=3 loops=2)"
" -> Seq Scan on profile_date_politics_type ""profile_date:politics_type"" (cost=0.00..1.03 rows=3 width=14) (actual time=0.016..0.019 rows=3 loops=1)"
" -> Hash (cost=1.12..1.12 rows=12 width=17) (actual time=0.750..0.751 rows=12 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_relationship_status_type ""profile_date:relationship_status_type"" (cost=0.00..1.12 rows=12 width=17) (actual time=0.020..0.021 rows=12 loops=1)"
" -> Materialize (cost=0.00..1.03 rows=2 width=15) (actual time=0.617..0.620 rows=2 loops=2)"
" -> Seq Scan on profile_date_relationship_monopoly_type ""profile_date:relationship_monopoly_type"" (cost=0.00..1.02 rows=2 width=15) (actual time=0.015..0.017 rows=2 loops=1)"
" -> Hash (cost=3.89..3.89 rows=14 width=16) (actual time=4.847..4.847 rows=14 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Hash Right Join (cost=1.32..3.89 rows=14 width=16) (actual time=4.191..4.224 rows=14 loops=1)"
" Hash Cond: (""profile_date:language_type"".id = ""profile_date:language_type_join"".language_type_id)"
" -> Seq Scan on profile_date_language_type ""profile_date:language_type"" (cost=0.00..1.88 rows=88 width=12) (actual time=0.013..0.022 rows=88 loops=1)"
" -> Hash (cost=1.14..1.14 rows=14 width=8) (actual time=1.341..1.341 rows=14 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_language ""profile_date:language_type_join"" (cost=0.00..1.14 rows=14 width=8) (actual time=0.753..0.763 rows=14 loops=1)"
" -> Materialize (cost=1.04..2.35 rows=2 width=16) (actual time=2.345..2.350 rows=2 loops=2)"
" -> Hash Right Join (cost=1.04..2.34 rows=2 width=16) (actual time=3.631..3.641 rows=2 loops=1)"
" Hash Cond: (""profile_date:pet_type"".id = ""profile_date:pet_type_join"".pet_type_id)"
" -> Seq Scan on profile_date_pet_type ""profile_date:pet_type"" (cost=0.00..1.20 rows=20 width=12) (actual time=0.009..0.013 rows=20 loops=1)"
" -> Hash (cost=1.02..1.02 rows=2 width=8) (actual time=0.557..0.557 rows=2 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_pet ""profile_date:pet_type_join"" (cost=0.00..1.02 rows=2 width=8) (actual time=0.035..0.037 rows=2 loops=1)"
" -> Hash (cost=1.04..1.04 rows=4 width=20) (actual time=1.362..1.362 rows=4 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_kid_type ""profile_date:kid_type"" (cost=0.00..1.04 rows=4 width=20) (actual time=0.019..0.022 rows=4 loops=1)"
" -> Hash (cost=1.04..1.04 rows=4 width=11) (actual time=0.677..0.677 rows=4 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_smoke_type ""profile_date:smoke_type"" (cost=0.00..1.04 rows=4 width=11) (actual time=0.026..0.028 rows=4 loops=1)"
" -> Hash (cost=1.03..1.03 rows=3 width=9) (actual time=0.625..0.625 rows=3 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_drink_type ""profile_date:drink_type"" (cost=0.00..1.03 rows=3 width=9) (actual time=0.015..0.017 rows=3 loops=1)"
" -> Hash (cost=1.03..1.03 rows=3 width=9) (actual time=0.522..0.522 rows=3 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_drug_type ""profile_date:drug_type"" (cost=0.00..1.03 rows=3 width=9) (actual time=0.013..0.015 rows=3 loops=1)"
" -> Hash (cost=1.05..1.05 rows=5 width=14) (actual time=0.567..0.567 rows=5 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_diet_type ""profile_date:diet_type"" (cost=0.00..1.05 rows=5 width=14) (actual time=0.022..0.026 rows=5 loops=1)"
" -> Hash (cost=2.23..2.23 rows=5 width=24) (actual time=5.219..5.219 rows=5 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Hash Left Join (cost=1.11..2.23 rows=5 width=24) (actual time=4.638..4.644 rows=5 loops=1)"
" Hash Cond: (""profile_date:love_language_type_join"".love_language_type_id = ""profile_date:love_language_type"".id)"
" -> Seq Scan on profile_date_love_language ""profile_date:love_language_type_join"" (cost=0.00..1.05 rows=5 width=8) (actual time=0.029..0.032 rows=5 loops=1)"
" -> Hash (cost=1.05..1.05 rows=5 width=20) (actual time=0.606..0.606 rows=5 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_love_language_type ""profile_date:love_language_type"" (cost=0.00..1.05 rows=5 width=20) (actual time=0.015..0.018 rows=5 loops=1)"
" -> Hash (cost=1.04..1.04 rows=4 width=15) (actual time=0.489..0.489 rows=4 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_exercise_level_type ""profile_date:exercise_level_type"" (cost=0.00..1.04 rows=4 width=15) (actual time=0.022..0.024 rows=4 loops=1)"
" -> Hash (cost=1.03..1.03 rows=3 width=16) (actual time=0.773..0.773 rows=3 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_have_place_type ""profile_date:have_place_type"" (cost=0.00..1.03 rows=3 width=16) (actual time=0.018..0.019 rows=3 loops=1)"
" -> Materialize (cost=0.00..1.03 rows=2 width=7) (actual time=0.712..1.084 rows=2 loops=2)"
" -> Seq Scan on profile_date_have_car_type ""profile_date:have_car_type"" (cost=0.00..1.02 rows=2 width=7) (actual time=0.013..0.016 rows=2 loops=1)"
" -> Hash (cost=1.12..1.12 rows=12 width=15) (actual time=1.430..1.430 rows=12 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_zodiac_type ""profile_date:zodiac_type"" (cost=0.00..1.12 rows=12 width=15) (actual time=0.950..0.952 rows=12 loops=1)"
" -> Hash (cost=1.16..1.16 rows=16 width=9) (actual time=0.484..0.484 rows=16 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_mbti_type ""profile_date:mbti_type"" (cost=0.00..1.16 rows=16 width=9) (actual time=0.018..0.019 rows=16 loops=1)"
" -> Materialize (cost=1.04..7.65 rows=2 width=47) (actual time=3.226..4.455 rows=2 loops=2)"
" -> Hash Right Join (cost=1.04..7.64 rows=2 width=47) (actual time=5.942..8.397 rows=2 loops=1)"
" Hash Cond: (""profile_date:country_have_travel_type"".id = ""profile_date:country_have_travel_type_join"".country_travel_type_id)"
" -> Seq Scan on profile_date_country_travel_type ""profile_date:country_have_travel_type"" (cost=0.00..5.60 rows=260 width=43) (actual time=0.616..2.429 rows=260 loops=1)"
" -> Hash (cost=1.02..1.02 rows=2 width=8) (actual time=2.081..2.081 rows=2 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_country_have_travel ""profile_date:country_have_travel_type_join"" (cost=0.00..1.02 rows=2 width=8) (actual time=1.474..1.477 rows=2 loops=1)"
" -> Hash (cost=1.05..1.05 rows=5 width=8) (actual time=0.597..0.597 rows=5 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_country_want_travel ""profile_date:country_want_travel_type_join"" (cost=0.00..1.05 rows=5 width=8) (actual time=0.018..0.021 rows=5 loops=1)"
" -> Hash (cost=3.05..3.05 rows=10 width=19) (actual time=5.332..5.332 rows=10 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Hash Right Join (cost=1.23..3.05 rows=10 width=19) (actual time=4.628..4.648 rows=10 loops=1)"
" Hash Cond: (""profile_date:activity_type"".id = ""profile_date:activity_type_join"".activity_type_id)"
" -> Seq Scan on profile_date_activity_type ""profile_date:activity_type"" (cost=0.00..1.48 rows=48 width=15) (actual time=0.472..0.477 rows=48 loops=1)"
" -> Hash (cost=1.10..1.10 rows=10 width=8) (actual time=0.585..0.585 rows=10 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_activity ""profile_date:activity_type_join"" (cost=0.00..1.10 rows=10 width=8) (actual time=0.038..0.041 rows=10 loops=1)"
" -> Hash (cost=2.49..2.49 rows=12 width=17) (actual time=6.342..6.342 rows=12 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Hash Left Join (cost=1.20..2.49 rows=12 width=17) (actual time=5.558..5.567 rows=12 loops=1)"
" Hash Cond: (""profile_date:cuisine_type_join"".cuisine_type_id = ""profile_date:cuisine_type"".id)"
" -> Seq Scan on profile_date_cuisine ""profile_date:cuisine_type_join"" (cost=0.00..1.12 rows=12 width=8) (actual time=1.197..1.198 rows=12 loops=1)"
" -> Hash (cost=1.09..1.09 rows=9 width=13) (actual time=1.317..1.318 rows=9 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_cuisine_type ""profile_date:cuisine_type"" (cost=0.00..1.09 rows=9 width=13) (actual time=0.017..0.021 rows=9 loops=1)"
" -> Hash (cost=5.60..5.60 rows=260 width=43) (actual time=2.914..2.914 rows=260 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 28kB"
" -> Seq Scan on profile_date_country_travel_type ""profile_date:country_want_travel_type"" (cost=0.00..5.60 rows=260 width=43) (actual time=0.024..0.067 rows=260 loops=1)"
" -> Hash (cost=1.07..1.07 rows=7 width=13) (actual time=0.600..0.600 rows=7 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_money_income_type ""profile_date:money_income_type"" (cost=0.00..1.07 rows=7 width=13) (actual time=0.014..0.016 rows=7 loops=1)"
" -> Hash (cost=1.05..1.05 rows=5 width=23) (actual time=0.546..0.546 rows=5 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_money_habit_type ""profile_date:money_habit_type"" (cost=0.00..1.05 rows=5 width=23) (actual time=0.014..0.016 rows=5 loops=1)"
" -> Hash (cost=1.03..1.03 rows=3 width=12) (actual time=1.498..1.498 rows=3 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_sex_health_type ""profile_date:sex_health_type"" (cost=0.00..1.03 rows=3 width=12) (actual time=0.017..0.019 rows=3 loops=1)"
" -> Hash (cost=1.05..1.05 rows=5 width=10) (actual time=0.759..0.759 rows=5 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_sex_drive_type ""profile_date:sex_drive_type"" (cost=0.00..1.05 rows=5 width=10) (actual time=0.031..0.033 rows=5 loops=1)"
" -> Hash (cost=2.26..2.26 rows=7 width=16) (actual time=10.412..10.412 rows=7 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Hash Left Join (cost=1.09..2.26 rows=7 width=16) (actual time=8.631..8.649 rows=7 loops=1)"
" Hash Cond: (""profile_date:looking_for_type_join"".looking_for_type_id = ""profile_date:looking_for_type"".id)"
" -> Seq Scan on profile_date_looking_for ""profile_date:looking_for_type_join"" (cost=0.00..1.07 rows=7 width=8) (actual time=0.029..0.037 rows=7 loops=1)"
" -> Hash (cost=1.04..1.04 rows=4 width=12) (actual time=1.325..1.325 rows=4 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on profile_date_looking_for_type ""profile_date:looking_for_type"" (cost=0.00..1.04 rows=4 width=12) (actual time=0.785..0.785 rows=4 loops=1)"
" -> Hash (cost=4.89..4.89 rows=39 width=56) (actual time=20.123..20.123 rows=42 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 12kB"
" -> Hash Right Join (cost=3.87..4.89 rows=39 width=56) (actual time=15.579..15.834 rows=42 loops=1)"
" Hash Cond: (profile_mod_link.profile_mod_id = profile_mod.id)"
" -> Sort (cost=2.42..2.52 rows=39 width=24) (actual time=10.480..10.490 rows=42 loops=1)"
" Sort Key: profile_mod_link.app_type_id"
" Sort Method: quicksort Memory: 28kB"
" -> Seq Scan on profile_mod_link (cost=0.00..1.39 rows=39 width=24) (actual time=0.048..0.093 rows=42 loops=1)"
" -> Hash (cost=1.20..1.20 rows=20 width=32) (actual time=0.909..0.909 rows=20 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 10kB"
" -> Seq Scan on profile_mod (cost=0.00..1.20 rows=20 width=32) (actual time=0.036..0.041 rows=20 loops=1)"
" -> Hash (cost=1.25..1.25 rows=1 width=4) (actual time=1.317..1.317 rows=1 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on ""like"" (cost=0.00..1.25 rows=1 width=4) (actual time=0.772..0.774 rows=1 loops=1)"
" Filter: (persona_1_id = 5)"
" Rows Removed by Filter: 19"
" -> Hash (cost=3.64..3.64 rows=18 width=765) (actual time=11.131..11.131 rows=18 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 12kB"
" -> Hash Left Join (cost=2.32..3.64 rows=18 width=765) (actual time=8.900..9.545 rows=18 loops=1)"
" Hash Cond: (""profile_mod:link:app_type"".id = ""profile_mod:link:app_type:pool_type_join"".app_type_id)"
" -> Seq Scan on profile_mod_app_type ""profile_mod:link:app_type"" (cost=0.00..1.18 rows=18 width=136) (actual time=0.024..0.028 rows=18 loops=1)"
" -> Hash (cost=2.23..2.23 rows=7 width=633) (actual time=6.336..6.336 rows=7 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Hash Left Join (cost=1.07..2.23 rows=7 width=633) (actual time=5.499..5.507 rows=7 loops=1)"
" Hash Cond: (""profile_mod:link:app_type:pool_type_join"".pool_type_id = ""profile_mod:link:app_type:pool_type"".id)"
" -> Seq Scan on profile_mod_pool_app ""profile_mod:link:app_type:pool_type_join"" (cost=0.00..1.07 rows=7 width=8) (actual time=0.729..0.732 rows=7 loops=1)"
" -> Hash (cost=1.03..1.03 rows=3 width=629) (actual time=0.830..0.830 rows=3 loops=1)"
" Buckets: 1024 Batches: 1 Memory Usage: 9kB"
" -> Seq Scan on pool_type ""profile_mod:link:app_type:pool_type"" (cost=0.00..1.03 rows=3 width=629) (actual time=0.020..0.023 rows=3 loops=1)"
"Planning time: 579.919 ms"
"Execution time: 11572.452 ms"
My database is suddenly hanging on some queries that join many tables and I see:

    temporary file size exceeds temp_file_limit (1025563kB)


A sample query and query plan can be seen here: https://pastebin.com/wug86Wrr

This query normally takes less than 100ms but hangs when hit temporary file size limit.

When I run:

    SELECT temp_files AS "Temporary files", temp_bytes AS "Size of temporary files"
    FROM pg_stat_database db;

I see:

    Temporary files  Size of temporary files
    ---
    22550          10651900248

How do I resolve this?

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/e85c7742-5586-4d27-b102-f4b0de0ac06c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thursday, March 21, 2019

[google-cloud-sql-discuss] Re: Console showing "Instance is being updated. This may take a few minutes.", but more than 1h and DONT STARTS!

Thanks for reporting this, I apologize for the delay. For issues of this nature please reach out though your support channel or file an issue tracker to receive assistance as it may be possible to restart the instance manually. If the issue is not resolved/occurs you can try restarting the instance[1] and failing that, please specify which operations were triggered which resulted in the stuck update and I will try to recreate your issue. 

[1] https://cloud.google.com/sql/docs/mysql/start-stop-restart-instance#restart

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/914e3a32-a845-4ad7-ac01-68b0832bacd2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Wednesday, March 20, 2019

[google-cloud-sql-discuss] pgstattuple only allowed by superuser

Hello,

I see that pgstattuple is a supported module, based in the official docs / changelog.

CREATE EXTENSION pgstattuple; runs with OK.

However, when I try to use module with 

SELECT * FROM pgstattuple('tablename');

It terminates with ERROR:  must be superuser to use pgstattuple functions.

I believe this is must be a bug, or otherwise why is this module advertised as supported?



--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/a650d8a8-1c03-44bc-b8de-0aa4d4debdc2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.