Am a beginner in SQL. How can I optimize this query
select * from t1 where parent_id in (select id from t1 where id= 'X')
UNION
select * from t1 where parent_id in (select id from t1 where parent_id in (select id from t1 where id= 'X'))
UNION
select * from t1 where parent_id in (select id from t1 where parent_id in (select id from t1 where parent_id in (select id from t1 where id= 'X')))