Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 4.07 KB | None | 0 0
  1.  Sort  (cost=5813.83..5814.56 ROWS=293 width=394) (actual TIME=874.721..875.611 ROWS=500 loops=1)
  2.    Sort KEY: ((COALESCE(t2.sell_total, 0::NUMERIC) - COALESCE((SUM(u0.total_price)), 0::NUMERIC)))
  3.    Sort Method:  quicksort  Memory: 140kB
  4.    ->  Hash JOIN  (cost=5062.40..5801.82 ROWS=293 width=394) (actual TIME=636.779..868.810 ROWS=500 loops=1)
  5.          Hash Cond: (ig.category_id = ic.id)
  6.          ->  Hash JOIN  (cost=5060.68..5791.68 ROWS=293 width=252) (actual TIME=636.543..860.394 ROWS=500 loops=1)
  7.                Hash Cond: (i.group_id = ig.id)
  8.                ->  MERGE JOIN  (cost=5034.96..5761.93 ROWS=293 width=252) (actual TIME=622.351..841.994 ROWS=500 loops=1)
  9.                      MERGE Cond: (i.id = (COALESCE(u0.item_id, t2.item_id)))
  10.                      ->  INDEX Scan USING thing_item_pkey ON thing_item i  (cost=0.00..674.85 ROWS=19091 width=40) (actual TIME=0.102..175.132 ROWS=18635 loops=1)
  11.                      ->  Sort  (cost=5034.96..5035.69 ROWS=293 width=216) (actual TIME=622.099..623.388 ROWS=500 loops=1)
  12.                            Sort KEY: (COALESCE(u0.item_id, t2.item_id))
  13.                            Sort Method:  quicksort  Memory: 81kB
  14.                            ->  MERGE FULL JOIN  (cost=5018.11..5022.96 ROWS=293 width=216) (actual TIME=615.534..620.378 ROWS=500 loops=1)
  15.                                  MERGE Cond: (u0.item_id = t2.item_id)
  16.                                  ->  Sort  (cost=2160.88..2161.31 ROWS=172 width=108) (actual TIME=233.715..234.599 ROWS=475 loops=1)
  17.                                        Sort KEY: u0.item_id
  18.                                        Sort Method:  quicksort  Memory: 50kB
  19.                                        ->  HashAggregate  (cost=2149.34..2152.78 ROWS=172 width=28) (actual TIME=230.936..232.371 ROWS=475 loops=1)
  20.                                              ->  Bitmap Heap Scan ON thing_transaction u0  (cost=467.23..1866.39 ROWS=22636 width=28) (actual TIME=11.662..129.660 ROWS=21573 loops=1)
  21.                                                    Recheck Cond: ((t_type)::text = 'B'::text)
  22.                                                    FILTER: ((DATE >= '2010-09-09 07:30:00+09:30'::TIMESTAMP WITH TIME zone) AND (DATE <= '2011-09-09 07:30:00+09:30'::TIMESTAMP WITH TIME zone) AND (corporation_id = 751993277))
  23.                                                    ->  Bitmap INDEX Scan ON thing_transaction_t_type  (cost=0.00..461.57 ROWS=27908 width=0) (actual TIME=11.308..11.308 ROWS=27680 loops=1)
  24.                                                          INDEX Cond: ((t_type)::text = 'B'::text)
  25.                                  ->  Sort  (cost=2857.23..2857.96 ROWS=293 width=108) (actual TIME=381.789..382.619 ROWS=463 loops=1)
  26.                                        Sort KEY: t2.item_id
  27.                                        Sort Method:  quicksort  Memory: 49kB
  28.                                        ->  Subquery Scan t2  (cost=2836.43..2845.22 ROWS=293 width=108) (actual TIME=377.099..380.402 ROWS=463 loops=1)
  29.                                              ->  HashAggregate  (cost=2836.43..2842.29 ROWS=293 width=28) (actual TIME=377.091..378.771 ROWS=463 loops=1)
  30.                                                    ->  Seq Scan ON thing_transaction u0  (cost=0.00..2352.92 ROWS=38681 width=28) (actual TIME=0.361..176.270 ROWS=39838 loops=1)
  31.                                                          FILTER: ((DATE >= '2010-09-09 07:30:00+09:30'::TIMESTAMP WITH TIME zone) AND (DATE <= '2011-09-09 07:30:00+09:30'::TIMESTAMP WITH TIME zone) AND (corporation_id = 751993277) AND ((t_type)::text = 'S'::text))
  32.                ->  Hash  (cost=15.32..15.32 ROWS=832 width=8) (actual TIME=14.151..14.151 ROWS=832 loops=1)
  33.                      ->  Seq Scan ON thing_itemgroup ig  (cost=0.00..15.32 ROWS=832 width=8) (actual TIME=3.636..12.366 ROWS=832 loops=1)
  34.          ->  Hash  (cost=1.32..1.32 ROWS=32 width=150) (actual TIME=0.179..0.179 ROWS=32 loops=1)
  35.                ->  Seq Scan ON thing_itemcategory ic  (cost=0.00..1.32 ROWS=32 width=150) (actual TIME=0.022..0.089 ROWS=32 loops=1)
  36.  Total runtime: 877.097 ms
  37. (36 ROWS)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement