The only free and comprehensive online etymological dictionary of the Spanish language
quien, quién (Relative Pronoun) "who"

10th cent. From Latin quem "whom," accusative of qui "who." From Proto-Italic *kwim "whom." From Proto-Indo-European *kwi̯m 'id.'

Italic: South Picene pim "who," Paelignian pam 'id.'

Indo-European: Celtic: Old Irish cía "who," Old Welsh pui> 'id.,' Old Breton pou 'id.,' Cornish pyw 'id.;' Germanic: Gothic ƕas "who," Old Norse hverr 'id.,' Old High German hwer 'id.,' Old Saxon hwē 'id.,' Old English hwā 'id.' (English who); Hellenic: Ancient Greek τίς (tís) "who," Thessalian κις (kis) 'id.,' Mycenaean jo-qi- 'id.;' Indo-Iranian: Sanskrit kím "what," "what for," Young Avestan cim "because;" Tocharian A kus "who," B kuse 'id.;' Anatolian: Hittite kui- "who," Cuneiform Luwian kui- 'id.,' Palaic kui- 'id.,' Lycian ti- 'id.,' Lydian qi- 'id.'

"[It is entirely possible that] *kwi-/kw- was a relative pronoun in Proto-Indo-European. Both items became relative pronouns during the histories of individual languages, possibly at a stage early enough to be considered 'dialectical Proto-Indo-European'. Most scholars taking this line conclude that Proto-Indo-European therefore had no relative clauses." ~ P. Probert, Early Greek Relative Clauses (2015)