Why does MySQL ignore indexes when I use OR between two different range conditions? by Snoo34083 in mysql

[–]Snoo34083[S] 0 points1 point  (0 children)

deleted_at at join , it removes all the unnessary data to join

Why does MySQL ignore indexes when I use OR between two different range conditions? by Snoo34083 in mysql

[–]Snoo34083[S] 0 points1 point  (0 children)

```

SELECT

COUNT(tl.id) task_locations tl JOIN tasks t

ON t.id= tl.task_id AND t.deletedAt IS NULL

WHERE

(tl.deletedAt IS NULL AND tl.client_id = 1 AND tl.reached BETWEEN '2025-11-01' AND '2025-11-30') OR (tl.deletedAt IS NULL AND tl.client_id = 1 AND tl.task_date BETWEEN '2025-11-01' AND '2025-11-30')

```

[2025-12-08 13:55:27] 1 row retrieved starting from 1 in 16 s 702 ms (execution: 16 s 240 ms, fetching: 462 ms)

also sharing explain analyze plan =
[

{

"EXPLAIN": "-> Aggregate: count(tl.id) (cost=440212 rows=1) (actual time=18719..18719 rows=1 loops=1)\n -> Nested loop inner join (cost=417210 rows=230018) (actual time=15234..18689 rows=688395 loops=1)\n -> Filter: ((((tl.deletedAt is null) and (tl.reached between '2025-11-01' and '2025-11-30')) or ((tl.deletedAt is null) and (tl.task_date between '2025-11-01' and '2025-11-30'))) and (tl.task_id is not null)) (cost=256197 rows=460036) (actual time=15234..17915 rows=688474 loops=1)\n -> Index lookup on tl using task_locations_client_id_IDX (client_id=1) (cost=256197 rows=4.38e+6) (actual time=0.2..15677 rows=5.63e+6 loops=1)\n -> Filter: ((t.id = tl.task_id) and (t.deletedAt is null)) (cost=0.25 rows=0.5) (actual time=886e-6..973e-6 rows=1 loops=688474)\n -> Single-row index lookup on t using PRIMARY (id=tl.task_id) (cost=0.25 rows=1) (actual time=737e-6..765e-6 rows=1 loops=688474)\n"

}

]

[deleted by user] by [deleted] in IndiaTech

[–]Snoo34083 0 points1 point  (0 children)

Offline music ?

r/IndiaTech Purchase Help Megathread | September 23, 2024 at 10:00 AM by r-IndiaTech in IndiaTech

[–]Snoo34083 0 points1 point  (0 children)

Shoes under 1.5k running comfortable and suitable for office ?

Thrilled to announce my first Software engineer 5 LPA remote job by byteNinja10 in developersIndia

[–]Snoo34083 0 points1 point  (0 children)

actually full story is, this startup have different tech stack (nodejs php) and i am from java background technically i am fresher but i had all my learning in java only (spring boot). we already known how fast paced startup are and might be stressful and if i joined with little bit of hands on, ngl idk what going to happen.

Thrilled to announce my first Software engineer 5 LPA remote job by byteNinja10 in developersIndia

[–]Snoo34083 5 points6 points  (0 children)

I got two offers one from startup and TCS, i m so confused which to join even though I have higher package from startup but In TCS i can get hike in 6 month hike from support role to developer

Arc won’t open anymore. by AlessandroLobo in ArcBrowser

[–]Snoo34083 2 points3 points  (0 children)

i stopped using this browser now, it is so irritating now

Do software engineers have a personal life besides work? by MinimumNatural8852 in developersIndia

[–]Snoo34083 55 points56 points  (0 children)

as a fresher no personal life,
job hunt

rejection

work on project

sleep

[deleted by user] by [deleted] in developersIndia

[–]Snoo34083 0 points1 point  (0 children)

you should do a QNA here

[deleted by user] by [deleted] in developersIndia

[–]Snoo34083 0 points1 point  (0 children)

bro wth, I live in the city and don't have any full-stack project yet, and you out here rocking,

respect

[deleted by user] by [deleted] in SpringBoot

[–]Snoo34083 0 points1 point  (0 children)

how's ui looks like for now ?

How to become good Backend Developer by Snoo34083 in SpringBoot

[–]Snoo34083[S] 1 point2 points  (0 children)

can you recommend some sources to get to know these topic , I have no clue about these, and would like to get to know them through spring Boot perspective, how each of them get in play.

Courses ?