Performance issue with XQuery
Background:
I have some hierarchical data that is organized in a little different way as usual for hierarchical data. I need to export this data in xml.
At first I tried to use DBMS_XMLGEN.newcontextfromhierarchy but the result was not satisfying.
Then I learned XQuery, and I came with a solution, but performance is bad.
Setup: (Test setup, real tables are more complex)
Oracle 10.2.0.4
1) Create tables
create table BLOC
(
bloc_id number not null,
name varchar2(30 char)
);
alter table BLOC
add constraint BLOC_PK primary key (BLOC_ID);
create table BLOC_FIELD
(
bloc_id number not null,
bloc_field_id number not null,