Skip to content

Instantly share code, notes, and snippets.

@Houdini
Created March 16, 2014 16:34
Show Gist options
  • Save Houdini/9585957 to your computer and use it in GitHub Desktop.
Save Houdini/9585957 to your computer and use it in GitHub Desktop.
"Limit (cost=7462.23..7462.26 rows=10 width=404) (actual time=174.219..174.221 rows=10 loops=1)"
" -> Sort (cost=7462.23..7588.10 rows=50345 width=404) (actual time=174.218..174.219 rows=10 loops=1)"
" Sort Key: (count(loans.*))"
" Sort Method: top-N heapsort Memory: 27kB"
" -> GroupAggregate (cost=0.00..6374.30 rows=50345 width=404) (actual time=0.036..153.099 rows=50285 loops=1)"
" -> Merge Left Join (cost=0.00..5610.68 rows=52033 width=404) (actual time=0.019..106.530 rows=52034 loops=1)"
" Merge Cond: (users.id = loans.user_id)"
" -> Index Scan using users_pkey on users (cost=0.00..2486.07 rows=50345 width=97) (actual time=0.008..26.936 rows=50285 loops=1)"
" -> Index Scan using index_loans_on_user_id on loans (cost=0.00..2348.34 rows=52033 width=311) (actual time=0.007..30.102 rows=52034 loops=1)"
"Total runtime: 174.269 ms"
"Nested Loop (cost=4164.77..4247.75 rows=10 width=109) (actual time=35.290..35.316 rows=10 loops=1)"
" -> Limit (cost=4164.77..4164.80 rows=10 width=4) (actual time=35.281..35.283 rows=10 loops=1)"
" -> Sort (cost=4164.77..4287.86 rows=49234 width=4) (actual time=35.279..35.280 rows=10 loops=1)"
" Sort Key: (count(*))"
" Sort Method: top-N heapsort Memory: 25kB"
" -> GroupAggregate (cost=0.00..3100.84 rows=49234 width=4) (actual time=0.022..30.013 rows=50285 loops=1)"
" -> Index Only Scan using index_loans_on_user_id on loans (cost=0.00..2348.34 rows=52033 width=4) (actual time=0.017..16.110 rows=52034 loops=1)"
" Heap Fetches: 52034"
" -> Index Scan using users_pkey on users (cost=0.00..8.28 rows=1 width=97) (actual time=0.002..0.002 rows=1 loops=10)"
" Index Cond: (id = loans.user_id)"
"Total runtime: 35.358 ms"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment