I am little bit confused and need some advice. I use PostgreSQL 11
database. I have such pretty simple sql statement:
SELECT DISTINCT "CITY", "AREA", "REGION"
FROM youtube
WHERE
"CITY" IS NOT NULL
AND
"AREA" IS NOT NULL
AND
"REGION" IS NOT NULL
youtube
table which I use in sql statement has 25 million records. I think for thats why query takes 15-17 seconds to complete. For web project where I use that query it's too long. I'm trying to speed up the request.
I create such index for youtube table:
CREATE INDEX youtube_location_idx ON public.youtube USING btree ("CITY", "AREA", "REGION");
After this step I run query again but it takes the same time to complete. It seems like query don't use index. How do I know if any index is used in a query?