my xml file looks like this
has about 3000 “recors” (tag )
and is really simple
<?xml version="1.0" encoding="ISO-8859-1"?>
<adapt_xml>
34093
…
34
<liste_photos>
adf_photo_2.jpg
adf_photo_7.jpg
adf_photo_4.jpg
…
</liste_photos>
…
</row
34093
…
34
<liste_photos>
adf_photo_2.jpg
adf_photo_7.jpg
adf_photo_4.jpg
…
</liste_photos>
…
the xml is stored in a xml table in Oracle (Version 11.2…)
i have to extract the values an store them in a relational table
for that I do the following statements
this is fast
SELECT
x1.field1,
x1.field2,
x1.field3,
…
x1.field50
FROM tmp_xml,
XMLTable(
‘//row’
passing OBJECT_VALUE
columns
field1 path ‘field1’,
field2 path ‘field2’,
field3 path ‘field3’,
…
field50 path ‘field50’
) x1
this is really slow
SELECT
x1.field1,
x1.field2,
x1.field3,
…
x1.field50,
x1.photo_1,
x1.photo_2,
x1.photo_3,
x1.photo_4,
x1.photo_5,
x1.photo_6,
x1.photo_7,
x1.photo_8,
x1.photo_9,
x1.photo_10,
x1.photo_11,
x1.photo_12,
x1.photo_13
FROM tmp_xml,
XMLTable(
‘//row’
passing OBJECT_VALUE
columns
field1 path ‘field1’,
field2 path ‘field2’,
field3 path ‘field3’,
…
field50 path ‘field50’,
photo_1 path ‘liste_photos/photo[1]’,
photo_2 path ‘liste_photos/photo[2]’,
photo_3 path ‘liste_photos/photo[3]’,
photo_4 path ‘liste_photos/photo[4]’,
photo_5 path ‘liste_photos/photo[5]’,
photo_6 path ‘liste_photos/photo[6]’,
photo_7 path ‘liste_photos/photo[7]’,
photo_8 path ‘liste_photos/photo[8]’,
photo_9 path ‘liste_photos/photo[9]’,
photo_10 path ‘liste_photos/photo[10]’,
photo_11 path ‘liste_photos/photo[11]’,
photo_12 path ‘liste_photos/photo[13]’,
photo_13 path ‘liste_photos/photo[13]’
) x1
this is slow as well
SELECT
x1.field1,
x1.field2,
x1.field3,
…
x1.field50,
x1.liste_photos,
FROM tmp_xml,
XMLTable(
‘//row’
passing OBJECT_VALUE
columns
field1 path ‘field1’,
field2 path ‘field2’,
field3 path ‘field3’,
…
field50 path ‘field50’,
liste_photos xmltype path ‘liste_photos’
) x1
I tried to crate some xmltype index
but no success
the select of the field1 … field50 is fast
but if I select the photo list the performance is going down
thanks
Martin