explain.depesz.com

PostgreSQL's explain analyze made readable

Result: P7vy

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 1,748.742 ↓ 0.0 0 1

Limit (cost=0.43..99,924.98 rows=3 width=76) (actual time=1,748.742..1,748.742 rows=0 loops=1)

2. 0.005 1,748.740 ↓ 0.0 0 1

Append (cost=0.43..99,924.98 rows=3 width=76) (actual time=1,748.740..1,748.740 rows=0 loops=1)

3. 589.725 589.725 ↓ 0.0 0 1

Index Scan using customers_on_plbwx5xygq2b3gp7in8q_partitioned2_p0_last_seen_idx on customers_on_plbwx5xygq2b3gp7in8q_partitioned2_p0 (cost=0.43..37,465.74 rows=1 width=76) (actual time=589.725..589.725 rows=0 loops=1)

  • Index Cond: (last_seen > (now() - '14 days'::interval))
  • Filter: ((user_last_msg_received IS NOT NULL) AND ((chat_platform_id)::text = 'whatsapp'::text) AND (((last_message)::json ->> 'FROM'::text) = 'me'::text) AND (((user_last_msg_received)::bigint)::double precision < (date_part('epoch'::text, last_message_creation_time) * '1000'::double precision)) AND (floor(((date_part('epoch'::text, last_message_creation_time) * '1000'::double precision) - ((user_last_msg_received)::bigint)::double precision)) > '86400'::double precision) AND (('1970-01-01 00:00:00+00'::timestamp with time zone + (((user_last_msg_received)::bigint)::double precision * '00:00:00.001'::interval)) < (now() - '24:00:00'::interval)) AND (('1970-01-01 00:00:00+00'::timestamp with time zone + (((user_last_msg_received)::bigint)::double precision * '00:00:00.001'::interval)) > (now() - '26:00:00'::interval)))
  • Rows Removed by Filter: 31030
4. 566.879 566.879 ↓ 0.0 0 1

Index Scan using customers_on_plbwx5xygq2b3gp7in8q_partitioned2_p1_last_seen_idx on customers_on_plbwx5xygq2b3gp7in8q_partitioned2_p1 (cost=0.43..31,579.59 rows=1 width=76) (actual time=566.879..566.879 rows=0 loops=1)

  • Index Cond: (last_seen > (now() - '14 days'::interval))
  • Filter: ((user_last_msg_received IS NOT NULL) AND ((chat_platform_id)::text = 'whatsapp'::text) AND (((last_message)::json ->> 'FROM'::text) = 'me'::text) AND (((user_last_msg_received)::bigint)::double precision < (date_part('epoch'::text, last_message_creation_time) * '1000'::double precision)) AND (floor(((date_part('epoch'::text, last_message_creation_time) * '1000'::double precision) - ((user_last_msg_received)::bigint)::double precision)) > '86400'::double precision) AND (('1970-01-01 00:00:00+00'::timestamp with time zone + (((user_last_msg_received)::bigint)::double precision * '00:00:00.001'::interval)) < (now() - '24:00:00'::interval)) AND (('1970-01-01 00:00:00+00'::timestamp with time zone + (((user_last_msg_received)::bigint)::double precision * '00:00:00.001'::interval)) > (now() - '26:00:00'::interval)))
  • Rows Removed by Filter: 30957
5. 592.131 592.131 ↓ 0.0 0 1

Index Scan using customers_on_plbwx5xygq2b3gp7in8q_partitioned2_p2_last_seen_idx on customers_on_plbwx5xygq2b3gp7in8q_partitioned2_p2 (cost=0.43..30,879.63 rows=1 width=76) (actual time=592.131..592.131 rows=0 loops=1)

  • Index Cond: (last_seen > (now() - '14 days'::interval))
  • Filter: ((user_last_msg_received IS NOT NULL) AND ((chat_platform_id)::text = 'whatsapp'::text) AND (((last_message)::json ->> 'FROM'::text) = 'me'::text) AND (((user_last_msg_received)::bigint)::double precision < (date_part('epoch'::text, last_message_creation_time) * '1000'::double precision)) AND (floor(((date_part('epoch'::text, last_message_creation_time) * '1000'::double precision) - ((user_last_msg_received)::bigint)::double precision)) > '86400'::double precision) AND (('1970-01-01 00:00:00+00'::timestamp with time zone + (((user_last_msg_received)::bigint)::double precision * '00:00:00.001'::interval)) < (now() - '24:00:00'::interval)) AND (('1970-01-01 00:00:00+00'::timestamp with time zone + (((user_last_msg_received)::bigint)::double precision * '00:00:00.001'::interval)) > (now() - '26:00:00'::interval)))
  • Rows Removed by Filter: 30961
Planning time : 0.785 ms
Execution time : 1,748.858 ms