jobs.id = 1 QUERY PLAN ----------------------------------------------------------------------- Index Scan using jobs_pkey on jobs (cost=0.29..8.31 rows=1 width=28) Index Cond: (id = 1) JOEFY͋Γ EXPLAIN SELECT jobs.* FROM jobs WHERE jobs.id = 1 QUERY PLAN ----------------------------------------------------------------------- Seq Scan on jobs (cost=0.00..1022.00 rows=1 width=28) Filter: (id = 1) JOEFYແ͠ JOEFYʹΑͬͯίετΛ͑Δࣄ͕Ͱ͖Δ
tourist_spots.country = “japan" AND tourist_spots.city = “tokyo” QUERY PLAN ----------------------------------------------------------------------- Index Scan using index_tourist_spots_on_country_and_city on tourist_spots (cost=0.42..8.44 rows=1 width=52) Index Cond: ((country = 'japan'::text) AND (city = 'tokyo'::text)) .VMUJDPMVNOJOEFY͋Γ EXPLAIN SELECT jobs.* FROM jobs WHERE jobs.id = 1 QUERY PLAN ----------------------------------------------------------------------- Index Scan using index_tourist_spot_without_multiple_indices_on_city on tourist_spot_without_multiple_indices (cost=0.42..8.44 rows=1 width=52) Index Cond: (city = ‘tokyo’::text) Filter: (country = 'japan'::text) .VMUJDPMVNOJOEFYແ͠
FROM profiles WHERE (lower(email) = '[email protected]') QUERY PLAN ----------------------------------------------------------------------- Index Scan using index_profiles_on_lower_email on profiles (cost=0.29..8.30 rows=1 width=48) Index Cond: (lower(email) = '[email protected]'::text) ৄࡉIUUQXXXQPTUHSFTRMPSHEPDTDVSSFOUTUBUJDJOEFYFTFYQSFTTJPOBMIUNMࢀর
BY viewed_at ASC LIMIT 20 QUERY PLAN ----------------------------------------------------------------------- Limit (cost=0.42..1.09 rows=20 width=28) -> Index Scan using index_page_view_log_with_indices_on_viewed_at on page_view_log_with_indices (cost=0.42..16698.78 rows=501024 width=28) *OEFYʹΑͬͯܶతʹίετ͕Լ͕Δ w ҎԼͷྫͰɺ ʹݮগʂ
4UFQ͝ͱʹɺ༷ʑͳख๏ΞϧΰϦζϜ͕ଘࡏ w બΕΔ࣮ߦܭըɺJOEFYͷ༗ແ౷ܭใʢσʔλྔɺσʔλʣʹґଘ దͳTDIFNB JOEFY RVFSZͷબ͕ॏཁ w 5JQT8)&3& +0*/ 03%&3#: (3061#:ͷLFZʹJOEFY w +0*/ͷલʹߜΓࠐΊΔͳΒߜΓࠐΉ ·ͱΊ
BY country ORDER BY id DESC) FROM companies QUERY PLAN ----------------------------------------------------------------------- WindowAgg (cost=936.35..1155.63 rows=10964 width=16) -> Sort (cost=936.35..963.76 rows=10964 width=16) Sort Key: country, id 1BSUJUJPO͝ͱʹɺΛܭࢉ͢Δػೳ w ߴػೳͳूؔΛར༻Մೳ country | rank --------------+------ britain | 1 china | 1 china | 2 china | 3 country_0 | 1 IUUQXXXQPTUHSFTRMPSHEPDTDVSSFOUTUBUJDUVUPSJBMXJOEPXIUNMΛࢀর