Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

terribly slow string split expression

Gor_MahiaOct 4 2021

Hi,
ive the below table with these sample entries. i want to split the CLASS_CODE string values based on the delimiter(,) and it works very well but the main problem the query is terribly slow even with filter as below,

STUDENT_TBL:
FK || CLASS_CODE ||.......

1 || X121_B, T521_A
2 || V4500_A
3 ||R709_H, Y7900, K900_Q

select DISTINCT STR FROM (
select regexp_substr(CLASS_CODE,'[^, ]+', 1, level) AS STR from STUDENT_TBL WHERE FK = 2
connect by regexp_substr(CLASS_CODE, '[^, ]+', 1, level) is not null
) Q ORDER BY 1
How can i tune this simple query or use alternative with better performance?

thank you.

This post has been answered by Frank Kulash on Oct 4 2021
Jump to Answer
Comments
Post Details
Added on Oct 4 2021
5 comments
1,276 views