Slow when joining with view

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux