Hacker News new | ask | show | jobs
by bayareaguy 6709 days ago
Although you can't index xml columns directly, you can define functional indexes over them. As long as you are careful to use the same function in your where clauses the index can be used.

Here's an example taken from Nikolay Samokhvalov's XML Support in PostgreSQL paper[1].

  CREATE INDEX i_table1_xdata ON table1 
  USING btree( xpath_array(xdata, '//person/@name') ); 
[1] - http://www.pgcon.org/2007/schedule/attachments/16-xml_in_pos...