explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gjHq

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 2,276.242 ↓ 0.0 0 1

Append (cost=0.43..99,918.52 rows=3 width=76) (actual time=2,276.242..2,276.242 rows=0 loops=1)

2. 835.431 835.431 ↓ 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,462.63 rows=1 width=76) (actual time=835.431..835.431 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: 31031
3. 774.331 774.331 ↓ 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,578.41 rows=1 width=76) (actual time=774.330..774.331 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: 30958
4. 666.476 666.476 ↓ 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,877.46 rows=1 width=76) (actual time=666.476..666.476 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: 30955
Planning time : 0.521 ms
Execution time : 2,276.339 ms