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.priority = %(priority_1)s LIMIT %(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.1911 ms
QUERY PLAN
Sort (cost=49.12..49.15 rows=11 width=224)
Sort Key: post.id
-> Nested Loop (cost=25.26..48.93 rows=11 width=224)
-> Nested Loop (cost=25.11..46.77 rows=11 width=8)
-> Limit (cost=0.00..10.88 rows=1 width=4)
-> Seq Scan on post (cost=0.00..10.88 rows=1 width=4)
Filter: (priority = 0)
-> Bitmap Heap Scan on categories categories_1 (cost=25.11..35.78 rows=11 width=8)
Recheck Cond: (post_id = post.id)
-> Bitmap Index Scan on categories_pkey (cost=0.00..25.11 rows=11 width=0)
Index Cond: (post_id = post.id)
-> Index Scan using category_pkey on category (cost=0.15..0.19 rows=1 width=220)
Index Cond: (id = categories_1.category_id)