skip to Main Content

Postgresql – How to improve sort performance in a huge dataset of 20 million rows?

So I have this query which is extremely slow to run - SELECT "conversation".*, "teamBotLocation"."id" AS "teamBotLocation.id", "teamBotLocation"."name" AS "teamBotLocation.name" FROM "conversation" AS "conversation" LEFT OUTER JOIN "teamBotLocation" AS "teamBotLocation" ON "conversation"."teamBotLocationId" = "teamBotLocation"."id" WHERE "conversation"."teamBotId" = 'some_id' AND "conversation"."teamBotLocationId"…

VIEW QUESTION

Why PostgreSQL doesn't use an index for JOIN

I have two tables "Tasks"(300k rows) and "TaskAssignedRoles"(500k rows). CREATE TABLE public."Tasks" ( "ID" uuid NOT NULL, "RowID" uuid NOT NULL, "Planned" timestamptz NOT NULL, CONSTRAINT "pk_Tasks" PRIMARY KEY ("RowID") ); CREATE INDEX "idx_Tasks_ID" ON public."Tasks" USING btree ("ID"); CREATE…

VIEW QUESTION

Mysql – Improving performance of SQL query for time series data

I'm writing a query in MySQL for a Grafana dashboard, but the performance of only this particular query is very poor. This is the query: SELECT br.reading ,CONCAT(ino.project,"_",SUBSTRING_INDEX(br.sensor,"_",-1)) AS new_metric ,ino.vessel ,ADDTIME(DATE('2023-01-01'),-TIMEDIFF(ino.date,br.datetime)) AS norm_date ,br.sensor FROM db.milestones br INNER JOIN…

VIEW QUESTION
Back To Top
Search