Back

SQL Details

Executed SQL
EXPLAIN SELECT category.status AS category_status, category.created_at AS category_created_at, category.deleted_at AS category_deleted_at, category.id AS category_id, category.title AS category_title, category.slug AS category_slug, anon_1.post_id AS anon_1_post_id FROM (SELECT post.id AS post_id FROM post WHERE post.id = %(param_1)s) AS anon_1 JOIN categories AS categories_1 ON anon_1.post_id = categories_1.post_id JOIN category ON category.id = categories_1.category_id ORDER BY anon_1.post_id
Original query duration
1.1752 ms
QUERY PLAN
Nested Loop (cost=36.06..58.70 rows=11 width=224)
-> Index Only Scan using post_pkey on post (cost=0.14..8.16 rows=1 width=4)
Index Cond: (id = 4)
-> Hash Join (cost=35.92..50.43 rows=11 width=224)
Hash Cond: (category.id = categories_1.category_id)
-> Seq Scan on category (cost=0.00..13.20 rows=320 width=220)
-> Hash (cost=35.78..35.78 rows=11 width=8)
-> Bitmap Heap Scan on categories categories_1 (cost=25.11..35.78 rows=11 width=8)
Recheck Cond: (post_id = 4)
-> Bitmap Index Scan on categories_pkey (cost=0.00..25.11 rows=11 width=0)
Index Cond: (post_id = 4)