Skip to Main Content

General Development Discussions

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!

Querying table using composite primary key

Nandhini KMay 29 2024

I am trying to read record in pyspark script from huge oracle table which have composite primary key (lets say id1,id2)

If i query by using filter on id1 in (1,2,3,4 and so on) and id2 in (10) getting timeout error or long run

i am able to query only using below pattern

select * from table where id1=1 and id2 in (10)

union all

select * from table where id1=2 and id2 in (10)

union all

select * from table where id1=3 and id2 in (10)

union all

select * from table where id1=4 and id2 in (10)

and so on

Any suggestion to query without union all multiple times would help

Comments
Post Details