The case https://stackoverflow.com/questions/30861967/slow-when-joining-with-view
--
It doesn't make sense that this query took 10s:
explain analyze
SELECT x1.id
FROM (
SELECT id, data->>'open_course_id' oc_id
FROM student_credits
WHERE (data->>'student_id')::BIGINT = '5500'
) x1
JOIN (
SELECT id FROM V_OpenCourse_WithTC
WHERE semester_id = '53'
) x2 ON x1.oc_id::BIGINT = x2.id
when both of its components took less than 100ms:
SELECT id, data->>'open_course_id' oc_id
FROM student_credits
WHERE (data->>'student_id')::BIGINT = '5500'
SELECT id FROM V_OpenCourse_WithTC
WHERE semester_id = '53'
Best Regards,
Kiswono P
GB
Kiswono P
GB