explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 35NC

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 4,958.227 ↑ 1.0 101 1

Limit (cost=1,261,279.68..1,261,279.93 rows=101 width=24) (actual time=4,958.213..4,958.227 rows=101 loops=1)

2. 84.043 4,958.220 ↑ 2,964.2 101 1

Sort (cost=1,261,279.68..1,262,028.15 rows=299,389 width=24) (actual time=4,958.211..4,958.220 rows=101 loops=1)

  • Sort Key: thread.date_updated DESC NULLS LAST, thread.id DESC NULLS LAST
  • Sort Method: top-N heapsort Memory: 32kB
3. 120.937 4,874.177 ↓ 3.1 925,169 1

Group (cost=1,248,318.81..1,249,815.76 rows=299,389 width=24) (actual time=4,452.416..4,874.177 rows=925,169 loops=1)

  • Group Key: thread.id
4. 1,213.874 4,753.240 ↓ 3.1 925,169 1

Sort (cost=1,248,318.81..1,249,067.29 rows=299,389 width=24) (actual time=4,452.415..4,753.240 rows=925,169 loops=1)

  • Sort Key: thread.id DESC NULLS LAST
  • Sort Method: external merge Disk: 30680kB
5. 1,689.028 3,539.366 ↓ 3.1 925,169 1

Seq Scan on thread (cost=0.00..1,214,944.40 rows=299,389 width=24) (actual time=0.658..3,539.366 rows=925,169 loops=1)

  • Filter: ((NOT anonymized) AND ((SubPlan 1) && '{ROLE_MPS_OFFER_READ,ROLE_MPS_MODEL_READ,ROLE_MPS_MODEL_WRITE,ROLE_OP_TECHNICAL_SETTING_READ,ROLE_MPS_CATALOG_SEARCH,ROLE_OP_ORDER_DOCUMENT_WRITE,ROLE_OP_SHOP_WRITE,ROLE_MPS_CATALOG_W (...)ROLE_OP_PRODUCT_BULK_ACTION_READ",ROLE_OP_BILLING_CYCLE_WRITE,ROLE_OP_OPERATOR_MCI_READ,ROLE_OP_OPERATOR_MCM_WRITE,ROLE_OP_INVOICE_WRITE,ROLE_OP_SHOP_BANK_WRITE,ROLE_OP_SUPERVISOR_READ,ROLE_OP_SUPERVISOR_WRITE,"ROLE_MPS_LOCATION_WRITE",ROLE_OP_SUPERVISOR_APPLICATION_SETTING_WRITE,ROLE_OP_DASHBOARD_READ,ROLE_OP_EMAIL_LISTING_READ,ROLE_OP_BUSINESS_SETTING_READ,ROLE_OP_OPERATOR_ACCESS,ROLE_OP_ORDER_EXPORT,"ROLE_OP_INVOICE_READ",ROLE_OP_BATCH_ADMIN_READ,ROLE_MPS_DASHBOARD,ROLE_OP_ORDER_ADDITIONAL_FIELD_WRITE,ROLE_OP_ORDER_EVALUATION_READ,ROLE_OP_OPERATOR_MCM_READ,ROLE_OP_OPERATOR_MCI_WRITE,ROLE_MPS_CATEGORY_SEARCH,"ROLE_OP_ORDER_WRITE",ROLE_MPS_OFFER_WRITE,ROLE_MPS_MODEL_SEARCH,ROLE_OP_ORDER_INCIDENT_WRITE,ROLE_OP_PROMOTION_READ,ROLE_OP_RECALL_AND_REMINDER_WRITE,ROLE_OP_CATEGORY_AUTOCOMPLETE,ROLE_OP_TEST_SHOP_CONNECTOR,"ROLE_MPS_CATEGORY_WRITE",ROLE_MPS_CUSTOM_ATTRIBUTE_READ,ROLE_MPS_ORDER_INCIDENT_WRITE,ROLE_OP_API_ACCESS,ROLE_MPS_CATALOG_READ,ROLE_MPS_LOCATION_READ,ROLE_OP_PRODUCT_BULK_ACTION_WRITE,ROLE_MPS_CATEGORY_READ,"ROLE_OP_QUOTE_WRITE",ROLE_OP_OFFER_READ,ROLE_OP_BRAND_AUTOCOMPLETE,ROLE_OP_BATCH_ADMIN_WRITE,ROLE_OP_PAYMENT_VOUCHER_READ,ROLE_MPS_ORDER_CUSTOM_ATTRIBUTE_EDIT,ROLE_OP_ORDER_EVALUATION_WRITE,ROLE_OP_CATEGORY_WRITE,"ROLE_OP_SHOP_MCI_READ",ROLE_OP_BILLING_CYCLE_READ,ROLE_MPS_ORDER_READ,ROLE_MPS_OFFER_MESSAGE_WRITE,ROLE_OP_CUSTOMER_READ,ROLE_OP_RECALL_AND_REMINDER_READ,ROLE_OP_TRANSACTION_LOG_READ,"ROLE_MPS_ORDER_EVALUATION_READ",ROLE_OP_ORDER_READ,ROLE_OP_SHOP_AUTOCOMPLETE,ROLE_MPS_CUSTOM_ATTRIBUTE_WRITE,ROLE_OP_BUSINESS_SETTING_WRITE,ROLE_OP_OFFER_WRITE,ROLE_OP_SHOP_MCI_WRITE,ROLE_MPS_ORDER_MESSAGE_WRITE,"ROLE_OP_PRODUCT_WRITE",ROLE_MPS_ORDER_WRITE,ROLE_OP_TECHNICAL_SETTING_WRITE,ROLE_OP_EMAIL_DETAIL_READ,ROLE_OP_FRONT_API_KEY_WRITE,ROLE_OP_PROMOTION_WRITE,ROLE_MPS_ORDER_EXPORT,ROLE...}'::text[]))
6.          

SubPlan (for Seq Scan)

7. 925.169 1,850.338 ↑ 1.0 1 925,169

Aggregate (cost=1.25..1.26 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=925,169)

8. 925.169 925.169 ↑ 25.0 4 925,169

Function Scan on jsonb_array_elements_text x (cost=0.00..1.00 rows=100 width=32) (actual time=0.001..0.001 rows=4 loops=925,169)