SlideShare a Scribd company logo
1 of 63
Download to read offline
PostgreSQL and XML

           Peter Eisentraut
        petere@postgresql.org



Prague PostgreSQL Developers’ Day 2008
Current Developments     Future Developments   Use Cases   Conclusion




Outline



      1    Current Developments

      2    Future Developments

      3    Use Cases

      4    Conclusion
Current Developments     Future Developments   Use Cases   Conclusion




Outline



      1    Current Developments

      2    Future Developments

      3    Use Cases

      4    Conclusion
Current Developments          Future Developments   Use Cases   Conclusion




New Features



      Available in PostgreSQL 8.3:
              XML Data Type
              XML Publishing
              XML Export
              SQL:2003 conformance
              XPath
Current Developments     Future Developments   Use Cases   Conclusion


XML Data Type


Outline
      1    Current Developments
             XML Data Type
             XML Publishing
             XML Export
             XPath
      2    Future Developments
             DTD and XML Schema validation
             Annotated schema decomposition
             XSLT
             Performance Issues
             Full-Text Search
             Advanced Indexing
             More Ideas
      3    Use Cases
      4    Conclusion
Current Developments             Future Developments   Use Cases   Conclusion


XML Data Type


XML Data Type


      CREATE TABLE test (
          ...,
          data xml,
          ...
      );

      Features:
                Input checking
                Support functions
      Issues:
                Internal storage format (plain text)
                Encoding handling
Current Developments     Future Developments   Use Cases   Conclusion


XML Data Type


Using the XML Type
      Bizarre SQL way:

      INSERT INTO test VALUES (
          ...,
          XMLPARSE (DOCUMENT ’<foo>...</foo>’),
          ...
      );

      SELECT XMLSERIALIZE (DOCUMENT data AS varchar)
          FROM test;
Current Developments     Future Developments   Use Cases   Conclusion


XML Data Type


Using the XML Type
      Bizarre SQL way:

      INSERT INTO test VALUES (
          ...,
          XMLPARSE (DOCUMENT ’<foo>...</foo>’),
          ...
      );

      SELECT XMLSERIALIZE (DOCUMENT data AS varchar)
          FROM test;

      Simple PostgreSQL way:

      INSERT INTO test VALUES (... , ’<foo>...</foo>’, ...);

      SELECT data FROM test;
Current Developments                Future Developments   Use Cases   Conclusion


XML Data Type


XML Type Oddities



                No comparison operators
                To retrieve, use:
                       Cast to text, or
                       XPath, or
                       Other key column
                To index, use:
                       Cast to text, or
                       XPath
Current Developments      Future Developments   Use Cases   Conclusion


XML Publishing


Outline
      1     Current Developments
              XML Data Type
              XML Publishing
              XML Export
              XPath
      2     Future Developments
              DTD and XML Schema validation
              Annotated schema decomposition
              XSLT
              Performance Issues
              Full-Text Search
              Advanced Indexing
              More Ideas
      3     Use Cases
      4     Conclusion
Current Developments   Future Developments   Use Cases   Conclusion


XML Publishing


Producing XML Content

      The old way?

      SELECT ’<record id="’ || id || ’"><value>’
             || ad_hoc_escape_func(value)
             || ’</value></record>’
          FROM tab;
Current Developments   Future Developments   Use Cases   Conclusion


XML Publishing


Producing XML Content

      The old way?

      SELECT ’<record id="’ || id || ’"><value>’
             || ad_hoc_escape_func(value)
             || ’</value></record>’
          FROM tab;

      The new way:

      SELECT XMLELEMENT(NAME record,
                        XMLATTRIBUTES(id),
                        XMLELEMENT(NAME value, value))
          FROM tab;
Current Developments     Future Developments   Use Cases   Conclusion


XML Publishing


XMLELEMENT Example

      SQL:
      XMLROOT (
        XMLELEMENT (
           NAME ’gazonk’,
           XMLATTRIBUTES (
             ’val’ AS ’name’,
             1 + 1 AS ’num’
           ),
           XMLELEMENT (
             NAME ’qux’,
             ’foo’
           )
        ),
        VERSION ’1.0’,
        STANDALONE YES
      )
Current Developments     Future Developments             Use Cases     Conclusion


XML Publishing


XMLELEMENT Example

      SQL:                                     Result:
      XMLROOT (                                <?xml version=’1.0’
        XMLELEMENT (                                 standalone=’yes’ ?>
           NAME ’gazonk’,                      <gazonk name=’val’
           XMLATTRIBUTES (                             num=’2’>
             ’val’ AS ’name’,                    <qux>foo</qux>
             1 + 1 AS ’num’                    </gazonk>
           ),
           XMLELEMENT (
             NAME ’qux’,
             ’foo’
           )
        ),
        VERSION ’1.0’,
        STANDALONE YES
      )
Current Developments            Future Developments   Use Cases   Conclusion


XML Publishing


XMLFOREST Example

      SELECT xmlforest (
        "FirstName" as "FName", "LastName" as "LName",
        ’string’ as "str", "Title", "Region" )
      FROM "Demo"."demo"."Employees";

      might result in
      <FName>Nancy</FName>
      <LName>Davolio</LName>
      <str>string</str>
      <Title>Sales Representative</Title>
      <Region>WA</Region>
      . . .
      <FName>Anne</FName>
      <LName>Dodsworth</LName>
      <str>string</str>
      <Title>Sales Representative</Title>



      (1 row per record)
Current Developments    Future Developments   Use Cases      Conclusion


XML Publishing


XMLAGG Example

      SELECT xmlelement (’Emp’,
        xmlattributes (’Sales Representative’ as "Title"),
        xmlagg (xmlelement (’Name’, "FirstName", ’ ’, "LastName")))
        FROM "Demo"."demo"."Employees"
        WHERE "Title" = ’Sales Representative’;

      might result in
      <Emp Title="Sales Representative">
        <Name>Nancy Davolio</Name>
        <Name>Janet Leverling</Name>
        <Name>Margaret Peacock</Name>
        <Name>Michael Suyama</Name>
        <Name>Robert King</Name>
        <Name>Anne Dodsworth</Name>
      </Emp>

      (1 row)
Current Developments       Future Developments   Use Cases   Conclusion


XML Export


Outline
      1      Current Developments
               XML Data Type
               XML Publishing
               XML Export
               XPath
      2      Future Developments
               DTD and XML Schema validation
               Annotated schema decomposition
               XSLT
               Performance Issues
               Full-Text Search
               Advanced Indexing
               More Ideas
      3      Use Cases
      4      Conclusion
Current Developments         Future Developments    Use Cases      Conclusion


XML Export


XML Export



              Map table/schema/database contents to XML document
              Map table/schema/database schema to XML Schema
      Useful for:
              Downstream processing (e.g., SOAP, web services)
              Postprocessing using XSLT
              Backup???
              Display formats (alternative to psql’s HTML mode)
Current Developments   Future Developments   Use Cases          Conclusion


XML Export


XML Export Functions

      Data export:
      table_to_xml(tbl regclass, nulls boolean,
                   tableforest boolean, targetns text)
      query_to_xml(query text, nulls boolean,
                   tableforest boolean, targetns text)
      cursor_to_xml(cursor refcursor, count int, nulls boolean,
                    tableforest boolean, targetns text)

      Schema export:
      table_to_xmlschema(tbl regclass, nulls boolean,
                         tableforest boolean, targetns text)
      query_to_xmlschema(query text, nulls boolean,
                         tableforest boolean, targetns text)
      cursor_to_xmlschema(cursor refcursor, nulls boolean,
                          tableforest boolean, targetns text)
Current Developments            Future Developments             Use Cases             Conclusion


XML Export


XML Schema Mapping Example


      CREATE TABLE test (a int PRIMARY KEY, b varchar(200));

      is mapped to
      <xsd:complexType name="RowType.catalog.schema.test">
        <xsd:sequence>
          <xsd:element name="a" type="INTEGER"></xsd:element>
          <xsd:element name="b" type="VARCHAR_200_200" minOccurs="0"></xsd:element>
        </xsd:sequence>
      </xsd:complexType>

      <xsd:complexType name="TableType.catalog.schema.test">
        <xsd:sequence>
          <xsd:element name="row"
              type="RowType.catalog.schema.test"
              minOccurs="0"
              maxOccurs="unbounded" />
        </xsd:sequence>
      </xsd:complexType>
Current Developments   Future Developments   Use Cases   Conclusion


XML Export


XML Export Format Example


      <catalogname>
        <schemaname>
          <tablename>
            <row>
              <colname1>value</colname1>
              <colname2 xsi:nil=’true’/>
              ...
            </row>
            ...
          </tablename>
          ...
        </schemaname>
        ...
      </catalogname>
Current Developments      Future Developments   Use Cases   Conclusion


XPath


Outline
        1   Current Developments
              XML Data Type
              XML Publishing
              XML Export
              XPath
        2   Future Developments
              DTD and XML Schema validation
              Annotated schema decomposition
              XSLT
              Performance Issues
              Full-Text Search
              Advanced Indexing
              More Ideas
        3   Use Cases
        4   Conclusion
Current Developments     Future Developments   Use Cases       Conclusion


XPath


XPath example




        Example table:
        CREATE TABLE table1(
            id      integer PRIMARY KEY,
            created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
            xdata   xml
        );
Current Developments        Future Developments    Use Cases         Conclusion


XPath


XPath Example

        Example data:
        INSERT INTO table1 (id, xdata) VALUES(
          1,
          ’<dept xmlns:smpl="http://example.com" smpl:did="DPT011-IT">
             <name>IT</name>
             <persons>
               <person smpl:pid="111">
                 <name>John Smith</name>
                 <age>24</age>
                 </person>
                 <person smpl:pid="112">
                   <name>Michael Black</name>
                   <age>28</age>
                 </person>
             </persons>
          </dept>’
        );
Current Developments      Future Developments   Use Cases         Conclusion


XPath


XPath Example


        Simple example query:
        SELECT * FROM table1
          WHERE (xpath(’//person/name/text()’, xdata))[1]::text
                 = ’John Smith’;

        And using namespaces:
        SELECT * FROM table1
          WHERE (xpath(’//person/@smpl:pid’,
                   xdata,
                   ARRAY[ARRAY[’smpl’,
                               ’http://example.com’]]))::text
                = ’111’;
Current Developments        Future Developments    Use Cases            Conclusion


XPath


XPath: Indexes




        Use functional indexes to avoid XPath evaluation at run time:
        CREATE INDEX i_table1_xdata ON table1 USING btree (
            xpath(’//person/@name’, xdata)
        );
Current Developments     Future Developments   Use Cases   Conclusion




Outline



      1    Current Developments

      2    Future Developments

      3    Use Cases

      4    Conclusion
Current Developments             Future Developments   Use Cases   Conclusion




Future Developments



              DTD and XML Schema validation
              Annotated schema decomposition
              XSLT
              Performance issues
              Full-text search
              Advanced indexing (XLABEL)
              More, more, more
Current Developments            Future Developments   Use Cases   Conclusion


DTD and XML Schema validation


Outline
      1    Current Developments
             XML Data Type
             XML Publishing
             XML Export
             XPath
      2    Future Developments
             DTD and XML Schema validation
             Annotated schema decomposition
             XSLT
             Performance Issues
             Full-Text Search
             Advanced Indexing
             More Ideas
      3    Use Cases
      4    Conclusion
Current Developments            Future Developments   Use Cases   Conclusion


DTD and XML Schema validation


DTD and XML Schema validation

      DTD validation:
              Implemented for 8.3, DTD is passed by URI
              Should be extended to allow passing DTD as text

      XML Schema (XSD) validation (XMLVALIDATE per SQL:2006):
      INSERT INTO messages(msg)
        SELECT xmlvalidate(
          DOCUMENT ’<?xml ...’
          ACCORDING TO XMLSCHEMA NO NAMESPACE
          LOCATION ’http://mycompany.com/msg-schema’
        );

      (The result of XMLVALIDATE is a new XML value.)
Current Developments             Future Developments   Use Cases   Conclusion


Annotated schema decomposition


Outline
      1    Current Developments
             XML Data Type
             XML Publishing
             XML Export
             XPath
      2    Future Developments
             DTD and XML Schema validation
             Annotated schema decomposition
             XSLT
             Performance Issues
             Full-Text Search
             Advanced Indexing
             More Ideas
      3    Use Cases
      4    Conclusion
Current Developments             Future Developments   Use Cases       Conclusion


Annotated schema decomposition


Annotated schema decomposition


      In some cases decomposition of XML Schema to relational data
      is better (no storing XML data, XML serves as transport only):
              When we need to store only small parts of the XML data
              Already developed tools might be designed only for
              relational data
      During decomposition the following capabilities could be used:
              Data normalization
              Foreign keys creation
              Conditional insertion of data chunks
              Insert parts of initial XML document as XML values
Current Developments     Future Developments   Use Cases   Conclusion


XSLT


Outline
       1   Current Developments
             XML Data Type
             XML Publishing
             XML Export
             XPath
       2   Future Developments
             DTD and XML Schema validation
             Annotated schema decomposition
             XSLT
             Performance Issues
             Full-Text Search
             Advanced Indexing
             More Ideas
       3   Use Cases
       4   Conclusion
Current Developments         Future Developments    Use Cases   Conclusion


XSLT


XSLT




       The easiest way: adapt and expand contrib/xml2’s
       capabilities. Choose an approach:

              Move XSLT functionality to the core (and use
              --with-libxslt)
              Separate contrib/xslt
Current Developments          Future Developments   Use Cases   Conclusion


XSLT


XSLT




       Crazy idea: PL/XSLT
              Define transformations as functions
              Version 0.0.0 exists :-)
Current Developments      Future Developments   Use Cases   Conclusion


Performance Issues


Outline
      1     Current Developments
              XML Data Type
              XML Publishing
              XML Export
              XPath
      2     Future Developments
              DTD and XML Schema validation
              Annotated schema decomposition
              XSLT
              Performance Issues
              Full-Text Search
              Advanced Indexing
              More Ideas
      3     Use Cases
      4     Conclusion
Current Developments         Future Developments      Use Cases           Conclusion


Performance Issues


Performance Issues


      Ideas:
              Cache intermediate results to avoid redundant parsing and
              XPath evaluation
              Advanced physical storage to speedup access to arbitrary
              node in XML data
              Use PostgreSQL existing capabilities for full-text search
              Use additional structures/tables/indexes to avoid XPath
              evaluation at runtime
              Use slices (similar to array_extract_slice()) to avoid
              dealing with entire values (both in SELECT and UPDATE)
Current Developments       Future Developments   Use Cases   Conclusion


Full-Text Search


Outline
       1     Current Developments
               XML Data Type
               XML Publishing
               XML Export
               XPath
       2     Future Developments
               DTD and XML Schema validation
               Annotated schema decomposition
               XSLT
               Performance Issues
               Full-Text Search
               Advanced Indexing
               More Ideas
       3     Use Cases
       4     Conclusion
Current Developments       Future Developments     Use Cases   Conclusion


Full-Text Search


Full-Text Search



       Simple way to create FTS index (available in 8.3):
       CREATE INDEX i_table1_fts ON table1
         USING gist (
            to_tsvector(
              ’default’,
              array_to_string(xpath(’//text()’, xdata), ’ ’)
            )
         );
Current Developments      Future Developments   Use Cases    Conclusion


Full-Text Search


Full-Text Search

       Proposal for overloading of built-in to_tsvector():
       CREATE OR REPLACE FUNCTION to_tsvector(text, xml)
       RETURNS tsearch2.tsvector
       LANGUAGE SQL IMMUTABLE
       AS $$
           SELECT to_tsvector(
             $1,
             array_to_string(xpath(’//text()’, $2), ’ ’)
           );
       $$;

       CREATE INDEX i_table1_fts
         ON table1
         USING gist (to_tsvector(’default’, xdata));
Current Developments          Future Developments     Use Cases        Conclusion


Full-Text Search


Full-Text Search




       Further ideas for full-text search:
               Indexing parts of documents (available in 8.3, in some way)
               Element names in tsvector
               Relevance scoring (ranking)
               FTS parser for XML
Current Developments     Future Developments   Use Cases   Conclusion


Advanced Indexing


Outline
      1    Current Developments
             XML Data Type
             XML Publishing
             XML Export
             XPath
      2    Future Developments
             DTD and XML Schema validation
             Annotated schema decomposition
             XSLT
             Performance Issues
             Full-Text Search
             Advanced Indexing
             More Ideas
      3    Use Cases
      4    Conclusion
Current Developments         Future Developments        Use Cases    Conclusion


Advanced Indexing


XLABEL


      Idea:
              Enumerate all XML node names in one database-wide
              table (xnames)
              Store shredded data in additional table
              (columnname_xlabel)
              Use numbering scheme to encode nodes (e.g., ltree)
              Use GiST/GIN indexes for numbering scheme column
              Rewrite XPath expression to plain SQL statement
              Implement partial updates support to avoid massive index
              rebuilding
Current Developments    Future Developments        Use Cases   Conclusion


Advanced Indexing


XLABEL

      Enumerate all XML node names in the database:

                               Table: xnames

                       xname_id           xname_name
                       1                  person
                       2                  dept
                       3                  name
                       4                  did
                       5                  persons
                       ...                ...
Current Developments             Future Developments          Use Cases        Conclusion


Advanced Indexing


XLABEL
      For an XML column implicitly create additional table (using
      xlabel.register_column() function):

                                  Table: table1_xdata

                    tid   xlabel       node_type       xname_id   value
                    1     a            1 (elem.)       2          NULL
                    1     a.b          2 (attr.)       4          DPT011-IT
                    1     a.c          1 (elem.)       3          NULL
                    1     a.c.a        NULL            NULL       IT
                    ...   ...          ...             ...        ...
                    1     a.d.a.b      1 (elem.)       3          NULL
                    1     a.d.a.b.a    NULL            NULL       John Smith
                    ...   ...          ...             ...        ...



      CREATE INDEX i_table1_xdata_xlabel
        ON table1_xdata
        USING gist (xlabel);
Current Developments        Future Developments   Use Cases          Conclusion


Advanced Indexing


XLABEL


      Rewrite XPath expression to plain SQL statement:
      SELECT * FROM table1
      WHERE array_dims(xpath(’//person/name’, xdata)) IS NOT NULL;

      . . . becomes . . .
      SELECT * FROM table1
      WHERE EXISTS(
        SELECT 1
        FROM table1_xdata AS t1, table1_xdata AS t2
        WHERE t1.xname_id = 1 AND t2.xname_id = 3
              AND t3.xlabel <@ t1.xlabel
      );

      . . . where <@ means “is a child of”.
Current Developments              Future Developments   Use Cases    Conclusion


Advanced Indexing


XLABEL




      Current thoughts:
              Separate table is problematic (déjà vu: fti vs. tsearch2)
              It would be great if one structure solves 2 problems at
              once:
                       access to arbitrary node
                       SELECTs with XPath
Current Developments       Future Developments   Use Cases   Conclusion


More Ideas


Outline
      1      Current Developments
               XML Data Type
               XML Publishing
               XML Export
               XPath
      2      Future Developments
               DTD and XML Schema validation
               Annotated schema decomposition
               XSLT
               Performance Issues
               Full-Text Search
               Advanced Indexing
               More Ideas
      3      Use Cases
      4      Conclusion
Current Developments          Future Developments   Use Cases   Conclusion


More Ideas


More, more, more

              Inline ORDER BY for XMLAGG (SQL:2003)
              ... XMLAGG(XMLELEMENT(...) ORDER BY col1) ...
              XMLCAST (SQL:2006)
              XML Canonical
              Pretty-printing XML
              Registered XML Schemas (SQL:2006)
              Schema evolution
              Improve Data Model (XDM)
              XQuery support (SQL:2006)
              Updatable XML views (over relational data)
              Relax-NG validation
Current Developments         Future Developments     Use Cases         Conclusion


More Ideas


And even more!




              Bulk loader for XML data (parallelize the XML parsing)
              XML-awareness in APIs and PLs
              Additional contribs/projects (web services, ODF, DocBook
              utilities, etc.)
              New tools and applications, integration with existing ones
Current Developments     Future Developments   Use Cases   Conclusion




Outline



      1    Current Developments

      2    Future Developments

      3    Use Cases

      4    Conclusion
Current Developments        Future Developments   Use Cases   Conclusion




Use Cases




              Use Case 1: Document Management System
              Use Case 2: Store Logs in the Database
              Use Case 3: Heterogeneous Catalog
Current Developments    Future Developments    Use Cases        Conclusion




Use Case 1: Document Management System




      The primary goal: to store documents in the RDBMS as is
Current Developments     Future Developments       Use Cases      Conclusion




Use Case 2: Store Logs in the Database



                                Table: action

                       action_id                SERIAL
                       action_type_id           INT4
                       action_status_id         INT4
                       action_person_id         INT4
                       action_data              XML


      The primary goal: to achieve flexibility, avoid database schema
      changes (schema evolution)
Current Developments      Future Developments     Use Cases         Conclusion




Use Case 3: Heterogeneous Catalog




      Task: to build heterogeneous catalog (items of different types, a
      lot of properties)
Current Developments      Future Developments     Use Cases         Conclusion




Use Case 3: Heterogeneous Catalog




      Task: to build heterogeneous catalog (items of different types, a
      lot of properties)



                                        How?
Current Developments   Future Developments   Use Cases   Conclusion




Use Case 3: Heterogeneous Catalog

      Ugly way
Current Developments      Future Developments   Use Cases   Conclusion




Use Case 3: Heterogeneous Catalog


      Entity-Attribute-Value model
Current Developments    Future Developments   Use Cases   Conclusion




Use Case 3: Heterogeneous Catalog



      Semi-structured data approach
Current Developments       Future Developments      Use Cases           Conclusion




Use Case 3: Heterogeneous Catalog
      Metadata Query Interface for Heterogeneous Data Archives
      (International Virtual Observatory): http://alcor.sao.ru/php/search/
Current Developments     Future Developments   Use Cases   Conclusion




Outline



      1    Current Developments

      2    Future Developments

      3    Use Cases

      4    Conclusion
Current Developments          Future Developments    Use Cases         Conclusion




Credits



              J. Gray et al. for contrib/xml2
              Pavel Stehule for initial patch for SQL/XML publishing
              functions
              Nikolay Samokhvalov for Google Summer of Code 2006
              project and part of this presentation
              me :-)
              PostgreSQL developer community for fixing our bugs
Current Developments         Future Developments       Use Cases      Conclusion




More Information



              SQL:2006, Part 14: XML-Related Specifications
              PostgreSQL documentation
              XML Development Wiki Page:
              http://developer.postgresql.org/index.php/XML_Support

              N. Samokhvalov, “XML Support in PostgreSQL”,
              Proceedings of SYRCoDIS, Moscow, Russia, 2007,
              http://samokhvalov.com/syrcodis2007.ps

              pgsql-hackers@postgresql.org

More Related Content

What's hot

Spark SQL: Another 16x Faster After Tungsten: Spark Summit East talk by Brad ...
Spark SQL: Another 16x Faster After Tungsten: Spark Summit East talk by Brad ...Spark SQL: Another 16x Faster After Tungsten: Spark Summit East talk by Brad ...
Spark SQL: Another 16x Faster After Tungsten: Spark Summit East talk by Brad ...Spark Summit
 
Microsoft Azure Databricks
Microsoft Azure DatabricksMicrosoft Azure Databricks
Microsoft Azure DatabricksSascha Dittmann
 
Sum and Product Types - The Fruit Salad & Fruit Snack Example - From F# to Ha...
Sum and Product Types -The Fruit Salad & Fruit Snack Example - From F# to Ha...Sum and Product Types -The Fruit Salad & Fruit Snack Example - From F# to Ha...
Sum and Product Types - The Fruit Salad & Fruit Snack Example - From F# to Ha...Philip Schwarz
 
Apache Spark Core—Deep Dive—Proper Optimization
Apache Spark Core—Deep Dive—Proper OptimizationApache Spark Core—Deep Dive—Proper Optimization
Apache Spark Core—Deep Dive—Proper OptimizationDatabricks
 
Spark Summit EU talk by Ted Malaska
Spark Summit EU talk by Ted MalaskaSpark Summit EU talk by Ted Malaska
Spark Summit EU talk by Ted MalaskaSpark Summit
 
Accelerating Data Ingestion with Databricks Autoloader
Accelerating Data Ingestion with Databricks AutoloaderAccelerating Data Ingestion with Databricks Autoloader
Accelerating Data Ingestion with Databricks AutoloaderDatabricks
 
Sharding Methods for MongoDB
Sharding Methods for MongoDBSharding Methods for MongoDB
Sharding Methods for MongoDBMongoDB
 
Building large scale transactional data lake using apache hudi
Building large scale transactional data lake using apache hudiBuilding large scale transactional data lake using apache hudi
Building large scale transactional data lake using apache hudiBill Liu
 
Railway Oriented Programming
Railway Oriented ProgrammingRailway Oriented Programming
Railway Oriented ProgrammingScott Wlaschin
 
Using Apache Spark as ETL engine. Pros and Cons
Using Apache Spark as ETL engine. Pros and Cons          Using Apache Spark as ETL engine. Pros and Cons
Using Apache Spark as ETL engine. Pros and Cons Provectus
 
Apache doris (incubating) introduction
Apache doris (incubating) introductionApache doris (incubating) introduction
Apache doris (incubating) introductionleanderlee2
 
Dynamic Partition Pruning in Apache Spark
Dynamic Partition Pruning in Apache SparkDynamic Partition Pruning in Apache Spark
Dynamic Partition Pruning in Apache SparkDatabricks
 
Image Similarity Detection at Scale Using LSH and Tensorflow with Andrey Gusev
Image Similarity Detection at Scale Using LSH and Tensorflow with Andrey GusevImage Similarity Detection at Scale Using LSH and Tensorflow with Andrey Gusev
Image Similarity Detection at Scale Using LSH and Tensorflow with Andrey GusevDatabricks
 
PySpark dataframe
PySpark dataframePySpark dataframe
PySpark dataframeJaemun Jung
 
Presto on Apache Spark: A Tale of Two Computation Engines
Presto on Apache Spark: A Tale of Two Computation EnginesPresto on Apache Spark: A Tale of Two Computation Engines
Presto on Apache Spark: A Tale of Two Computation EnginesDatabricks
 
Advanced Postgres Monitoring
Advanced Postgres MonitoringAdvanced Postgres Monitoring
Advanced Postgres MonitoringDenish Patel
 
채팅서버의 부하 분산 사례
채팅서버의 부하 분산 사례채팅서버의 부하 분산 사례
채팅서버의 부하 분산 사례John Kim
 

What's hot (20)

Spark SQL: Another 16x Faster After Tungsten: Spark Summit East talk by Brad ...
Spark SQL: Another 16x Faster After Tungsten: Spark Summit East talk by Brad ...Spark SQL: Another 16x Faster After Tungsten: Spark Summit East talk by Brad ...
Spark SQL: Another 16x Faster After Tungsten: Spark Summit East talk by Brad ...
 
Microsoft Azure Databricks
Microsoft Azure DatabricksMicrosoft Azure Databricks
Microsoft Azure Databricks
 
Sum and Product Types - The Fruit Salad & Fruit Snack Example - From F# to Ha...
Sum and Product Types -The Fruit Salad & Fruit Snack Example - From F# to Ha...Sum and Product Types -The Fruit Salad & Fruit Snack Example - From F# to Ha...
Sum and Product Types - The Fruit Salad & Fruit Snack Example - From F# to Ha...
 
Apache Spark Core—Deep Dive—Proper Optimization
Apache Spark Core—Deep Dive—Proper OptimizationApache Spark Core—Deep Dive—Proper Optimization
Apache Spark Core—Deep Dive—Proper Optimization
 
Deep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDB Deep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDB
 
Spark Summit EU talk by Ted Malaska
Spark Summit EU talk by Ted MalaskaSpark Summit EU talk by Ted Malaska
Spark Summit EU talk by Ted Malaska
 
Accelerating Data Ingestion with Databricks Autoloader
Accelerating Data Ingestion with Databricks AutoloaderAccelerating Data Ingestion with Databricks Autoloader
Accelerating Data Ingestion with Databricks Autoloader
 
Sharding Methods for MongoDB
Sharding Methods for MongoDBSharding Methods for MongoDB
Sharding Methods for MongoDB
 
Building large scale transactional data lake using apache hudi
Building large scale transactional data lake using apache hudiBuilding large scale transactional data lake using apache hudi
Building large scale transactional data lake using apache hudi
 
Railway Oriented Programming
Railway Oriented ProgrammingRailway Oriented Programming
Railway Oriented Programming
 
Using Apache Spark as ETL engine. Pros and Cons
Using Apache Spark as ETL engine. Pros and Cons          Using Apache Spark as ETL engine. Pros and Cons
Using Apache Spark as ETL engine. Pros and Cons
 
Apache doris (incubating) introduction
Apache doris (incubating) introductionApache doris (incubating) introduction
Apache doris (incubating) introduction
 
Dynamic Partition Pruning in Apache Spark
Dynamic Partition Pruning in Apache SparkDynamic Partition Pruning in Apache Spark
Dynamic Partition Pruning in Apache Spark
 
Debugging Apache Spark
Debugging Apache SparkDebugging Apache Spark
Debugging Apache Spark
 
Image Similarity Detection at Scale Using LSH and Tensorflow with Andrey Gusev
Image Similarity Detection at Scale Using LSH and Tensorflow with Andrey GusevImage Similarity Detection at Scale Using LSH and Tensorflow with Andrey Gusev
Image Similarity Detection at Scale Using LSH and Tensorflow with Andrey Gusev
 
PySpark dataframe
PySpark dataframePySpark dataframe
PySpark dataframe
 
Presto on Apache Spark: A Tale of Two Computation Engines
Presto on Apache Spark: A Tale of Two Computation EnginesPresto on Apache Spark: A Tale of Two Computation Engines
Presto on Apache Spark: A Tale of Two Computation Engines
 
Advanced Postgres Monitoring
Advanced Postgres MonitoringAdvanced Postgres Monitoring
Advanced Postgres Monitoring
 
File system node js
File system node jsFile system node js
File system node js
 
채팅서버의 부하 분산 사례
채팅서버의 부하 분산 사례채팅서버의 부하 분산 사례
채팅서버의 부하 분산 사례
 

Viewers also liked

PostgreSQL 9.5 Foreign Data Wrappers
PostgreSQL 9.5 Foreign Data WrappersPostgreSQL 9.5 Foreign Data Wrappers
PostgreSQL 9.5 Foreign Data WrappersNicholas Kiraly
 
Was sind eigentlich semantische Technologien
Was sind eigentlich semantische TechnologienWas sind eigentlich semantische Technologien
Was sind eigentlich semantische TechnologienValentin Zacharias
 
Keeping it small: Getting to know the Slim micro framework
Keeping it small: Getting to know the Slim micro frameworkKeeping it small: Getting to know the Slim micro framework
Keeping it small: Getting to know the Slim micro frameworkJeremy Kendall
 
DBMS lab manual
DBMS lab manualDBMS lab manual
DBMS lab manualmaha tce
 
CITY OF SPIES BY SORAYYA KHAN
CITY OF SPIES BY SORAYYA KHANCITY OF SPIES BY SORAYYA KHAN
CITY OF SPIES BY SORAYYA KHANSheikh Hasnain
 
Scalable Internet Servers and Load Balancing
Scalable Internet Servers and Load BalancingScalable Internet Servers and Load Balancing
Scalable Internet Servers and Load BalancingInformation Technology
 
Intoduction to Network Security NS1
Intoduction to Network Security NS1Intoduction to Network Security NS1
Intoduction to Network Security NS1koolkampus
 
Intelligence, spies & espionage
Intelligence, spies & espionageIntelligence, spies & espionage
Intelligence, spies & espionagedgnadt
 
Functional programming with python
Functional programming with pythonFunctional programming with python
Functional programming with pythonMarcelo Cure
 
What is Network Security?
What is Network Security?What is Network Security?
What is Network Security?Faith Zeller
 

Viewers also liked (20)

PostgreSQL 9.5 Foreign Data Wrappers
PostgreSQL 9.5 Foreign Data WrappersPostgreSQL 9.5 Foreign Data Wrappers
PostgreSQL 9.5 Foreign Data Wrappers
 
Mobile bigdata
Mobile bigdataMobile bigdata
Mobile bigdata
 
Was sind eigentlich semantische Technologien
Was sind eigentlich semantische TechnologienWas sind eigentlich semantische Technologien
Was sind eigentlich semantische Technologien
 
Keeping it small: Getting to know the Slim micro framework
Keeping it small: Getting to know the Slim micro frameworkKeeping it small: Getting to know the Slim micro framework
Keeping it small: Getting to know the Slim micro framework
 
Sql queries
Sql queriesSql queries
Sql queries
 
DBMS lab manual
DBMS lab manualDBMS lab manual
DBMS lab manual
 
Noah Z - Spies
Noah Z - SpiesNoah Z - Spies
Noah Z - Spies
 
SAN
SANSAN
SAN
 
CITY OF SPIES BY SORAYYA KHAN
CITY OF SPIES BY SORAYYA KHANCITY OF SPIES BY SORAYYA KHAN
CITY OF SPIES BY SORAYYA KHAN
 
Securing Windows web servers
Securing Windows web serversSecuring Windows web servers
Securing Windows web servers
 
Trends in spies
Trends in spiesTrends in spies
Trends in spies
 
Scalable Internet Servers and Load Balancing
Scalable Internet Servers and Load BalancingScalable Internet Servers and Load Balancing
Scalable Internet Servers and Load Balancing
 
Serial Killers Presentation1
Serial Killers Presentation1Serial Killers Presentation1
Serial Killers Presentation1
 
Intoduction to Network Security NS1
Intoduction to Network Security NS1Intoduction to Network Security NS1
Intoduction to Network Security NS1
 
Carrick - Introduction to Physics & Electronics - Spring Review 2012
Carrick - Introduction to Physics & Electronics - Spring Review 2012Carrick - Introduction to Physics & Electronics - Spring Review 2012
Carrick - Introduction to Physics & Electronics - Spring Review 2012
 
Intelligence, spies & espionage
Intelligence, spies & espionageIntelligence, spies & espionage
Intelligence, spies & espionage
 
Android UI
Android UIAndroid UI
Android UI
 
Lec 03 set
Lec 03   setLec 03   set
Lec 03 set
 
Functional programming with python
Functional programming with pythonFunctional programming with python
Functional programming with python
 
What is Network Security?
What is Network Security?What is Network Security?
What is Network Security?
 

Similar to PostgreSQL and XML

The Road to the XML Type: Current and Future Developments
The Road to the XML Type: Current and Future DevelopmentsThe Road to the XML Type: Current and Future Developments
The Road to the XML Type: Current and Future DevelopmentsPeter Eisentraut
 
eXtensible Markup Language (XML)
eXtensible Markup Language (XML)eXtensible Markup Language (XML)
eXtensible Markup Language (XML)Serhii Kartashov
 
XML Support: Specifications and Development
XML Support: Specifications and DevelopmentXML Support: Specifications and Development
XML Support: Specifications and DevelopmentPeter Eisentraut
 
20070524 Pgcon2007 Roadtoxmltype
20070524 Pgcon2007 Roadtoxmltype20070524 Pgcon2007 Roadtoxmltype
20070524 Pgcon2007 RoadtoxmltypeNikolay Samokhvalov
 
XSLT 3.0 - new features
XSLT 3.0 - new featuresXSLT 3.0 - new features
XSLT 3.0 - new featuresJakub Malý
 
Dax Declarative Api For Xml
Dax   Declarative Api For XmlDax   Declarative Api For Xml
Dax Declarative Api For XmlLars Trieloff
 
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...Marco Gralike
 
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1Marco Gralike
 
Xslt by asfak mahamud
Xslt by asfak mahamudXslt by asfak mahamud
Xslt by asfak mahamudAsfak Mahamud
 
XML Schema Patterns for Databinding
XML Schema Patterns for DatabindingXML Schema Patterns for Databinding
XML Schema Patterns for DatabindingPaul Downey
 
XML - State of the Art
XML - State of the ArtXML - State of the Art
XML - State of the ArtJakub Malý
 
Internet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web TechnologyInternet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web TechnologyAyes Chinmay
 
ibm_research_aug_8_03
ibm_research_aug_8_03ibm_research_aug_8_03
ibm_research_aug_8_03Attila Barta
 

Similar to PostgreSQL and XML (20)

The Road to the XML Type: Current and Future Developments
The Road to the XML Type: Current and Future DevelopmentsThe Road to the XML Type: Current and Future Developments
The Road to the XML Type: Current and Future Developments
 
eXtensible Markup Language (XML)
eXtensible Markup Language (XML)eXtensible Markup Language (XML)
eXtensible Markup Language (XML)
 
XML Support: Specifications and Development
XML Support: Specifications and DevelopmentXML Support: Specifications and Development
XML Support: Specifications and Development
 
20070524 Pgcon2007 Roadtoxmltype
20070524 Pgcon2007 Roadtoxmltype20070524 Pgcon2007 Roadtoxmltype
20070524 Pgcon2007 Roadtoxmltype
 
XSLT 3.0 - new features
XSLT 3.0 - new featuresXSLT 3.0 - new features
XSLT 3.0 - new features
 
Day2 xslt x_path_xquery
Day2 xslt x_path_xqueryDay2 xslt x_path_xquery
Day2 xslt x_path_xquery
 
DB2 Native XML
DB2 Native XMLDB2 Native XML
DB2 Native XML
 
Dax Declarative Api For Xml
Dax   Declarative Api For XmlDax   Declarative Api For Xml
Dax Declarative Api For Xml
 
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
 
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
 
Xslt by asfak mahamud
Xslt by asfak mahamudXslt by asfak mahamud
Xslt by asfak mahamud
 
Xml presentation
Xml presentationXml presentation
Xml presentation
 
XML Schema Patterns for Databinding
XML Schema Patterns for DatabindingXML Schema Patterns for Databinding
XML Schema Patterns for Databinding
 
XML - State of the Art
XML - State of the ArtXML - State of the Art
XML - State of the Art
 
Java XML Parsing
Java XML ParsingJava XML Parsing
Java XML Parsing
 
Xml session
Xml sessionXml session
Xml session
 
Internet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web TechnologyInternet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web Technology
 
Data shapes-test-suite
Data shapes-test-suiteData shapes-test-suite
Data shapes-test-suite
 
Sax Dom Tutorial
Sax Dom TutorialSax Dom Tutorial
Sax Dom Tutorial
 
ibm_research_aug_8_03
ibm_research_aug_8_03ibm_research_aug_8_03
ibm_research_aug_8_03
 

More from Peter Eisentraut

Programming with Python and PostgreSQL
Programming with Python and PostgreSQLProgramming with Python and PostgreSQL
Programming with Python and PostgreSQLPeter Eisentraut
 
Getting Started with PL/Proxy
Getting Started with PL/ProxyGetting Started with PL/Proxy
Getting Started with PL/ProxyPeter Eisentraut
 
Linux distribution for the cloud
Linux distribution for the cloudLinux distribution for the cloud
Linux distribution for the cloudPeter Eisentraut
 
Most Wanted: Future PostgreSQL Features
Most Wanted: Future PostgreSQL FeaturesMost Wanted: Future PostgreSQL Features
Most Wanted: Future PostgreSQL FeaturesPeter Eisentraut
 
Porting Applications From Oracle To PostgreSQL
Porting Applications From Oracle To PostgreSQLPorting Applications From Oracle To PostgreSQL
Porting Applications From Oracle To PostgreSQLPeter Eisentraut
 
Porting Oracle Applications to PostgreSQL
Porting Oracle Applications to PostgreSQLPorting Oracle Applications to PostgreSQL
Porting Oracle Applications to PostgreSQLPeter Eisentraut
 
PostgreSQL: Die Freie Datenbankalternative
PostgreSQL: Die Freie DatenbankalternativePostgreSQL: Die Freie Datenbankalternative
PostgreSQL: Die Freie DatenbankalternativePeter Eisentraut
 
Access ohne Access: Freie Datenbank-Frontends
Access ohne Access: Freie Datenbank-FrontendsAccess ohne Access: Freie Datenbank-Frontends
Access ohne Access: Freie Datenbank-FrontendsPeter Eisentraut
 
Replication Solutions for PostgreSQL
Replication Solutions for PostgreSQLReplication Solutions for PostgreSQL
Replication Solutions for PostgreSQLPeter Eisentraut
 
Access ohne Access: Freie Datenbank-Frontends
Access ohne Access: Freie Datenbank-FrontendsAccess ohne Access: Freie Datenbank-Frontends
Access ohne Access: Freie Datenbank-FrontendsPeter Eisentraut
 
Docbook: Textverarbeitung mit XML
Docbook: Textverarbeitung mit XMLDocbook: Textverarbeitung mit XML
Docbook: Textverarbeitung mit XMLPeter Eisentraut
 
Collateral Damage: Consequences of Spam and Virus Filtering for the E-Mail Sy...
Collateral Damage: Consequences of Spam and Virus Filtering for the E-Mail Sy...Collateral Damage: Consequences of Spam and Virus Filtering for the E-Mail Sy...
Collateral Damage: Consequences of Spam and Virus Filtering for the E-Mail Sy...Peter Eisentraut
 
Collateral Damage: Consequences of Spam and Virus Filtering for the E-Mail S...
Collateral Damage:
Consequences of Spam and Virus Filtering for the E-Mail S...Collateral Damage:
Consequences of Spam and Virus Filtering for the E-Mail S...
Collateral Damage: Consequences of Spam and Virus Filtering for the E-Mail S...Peter Eisentraut
 
The Common Debian Build System (CDBS)
The Common Debian Build System (CDBS)The Common Debian Build System (CDBS)
The Common Debian Build System (CDBS)Peter Eisentraut
 
The Lives of Others: Open-Source Development Practices Elsewhere
The Lives of Others: Open-Source Development Practices ElsewhereThe Lives of Others: Open-Source Development Practices Elsewhere
The Lives of Others: Open-Source Development Practices ElsewherePeter Eisentraut
 

More from Peter Eisentraut (20)

Programming with Python and PostgreSQL
Programming with Python and PostgreSQLProgramming with Python and PostgreSQL
Programming with Python and PostgreSQL
 
Getting Started with PL/Proxy
Getting Started with PL/ProxyGetting Started with PL/Proxy
Getting Started with PL/Proxy
 
Linux distribution for the cloud
Linux distribution for the cloudLinux distribution for the cloud
Linux distribution for the cloud
 
Most Wanted: Future PostgreSQL Features
Most Wanted: Future PostgreSQL FeaturesMost Wanted: Future PostgreSQL Features
Most Wanted: Future PostgreSQL Features
 
Porting Applications From Oracle To PostgreSQL
Porting Applications From Oracle To PostgreSQLPorting Applications From Oracle To PostgreSQL
Porting Applications From Oracle To PostgreSQL
 
Porting Oracle Applications to PostgreSQL
Porting Oracle Applications to PostgreSQLPorting Oracle Applications to PostgreSQL
Porting Oracle Applications to PostgreSQL
 
PostgreSQL: Die Freie Datenbankalternative
PostgreSQL: Die Freie DatenbankalternativePostgreSQL: Die Freie Datenbankalternative
PostgreSQL: Die Freie Datenbankalternative
 
Access ohne Access: Freie Datenbank-Frontends
Access ohne Access: Freie Datenbank-FrontendsAccess ohne Access: Freie Datenbank-Frontends
Access ohne Access: Freie Datenbank-Frontends
 
PostgreSQL and PL/Java
PostgreSQL and PL/JavaPostgreSQL and PL/Java
PostgreSQL and PL/Java
 
Replication Solutions for PostgreSQL
Replication Solutions for PostgreSQLReplication Solutions for PostgreSQL
Replication Solutions for PostgreSQL
 
PostgreSQL News
PostgreSQL NewsPostgreSQL News
PostgreSQL News
 
PostgreSQL News
PostgreSQL NewsPostgreSQL News
PostgreSQL News
 
Access ohne Access: Freie Datenbank-Frontends
Access ohne Access: Freie Datenbank-FrontendsAccess ohne Access: Freie Datenbank-Frontends
Access ohne Access: Freie Datenbank-Frontends
 
Docbook: Textverarbeitung mit XML
Docbook: Textverarbeitung mit XMLDocbook: Textverarbeitung mit XML
Docbook: Textverarbeitung mit XML
 
Collateral Damage: Consequences of Spam and Virus Filtering for the E-Mail Sy...
Collateral Damage: Consequences of Spam and Virus Filtering for the E-Mail Sy...Collateral Damage: Consequences of Spam and Virus Filtering for the E-Mail Sy...
Collateral Damage: Consequences of Spam and Virus Filtering for the E-Mail Sy...
 
Collateral Damage: Consequences of Spam and Virus Filtering for the E-Mail S...
Collateral Damage:
Consequences of Spam and Virus Filtering for the E-Mail S...Collateral Damage:
Consequences of Spam and Virus Filtering for the E-Mail S...
Collateral Damage: Consequences of Spam and Virus Filtering for the E-Mail S...
 
Spaß mit PostgreSQL
Spaß mit PostgreSQLSpaß mit PostgreSQL
Spaß mit PostgreSQL
 
The Common Debian Build System (CDBS)
The Common Debian Build System (CDBS)The Common Debian Build System (CDBS)
The Common Debian Build System (CDBS)
 
SQL/MED and PostgreSQL
SQL/MED and PostgreSQLSQL/MED and PostgreSQL
SQL/MED and PostgreSQL
 
The Lives of Others: Open-Source Development Practices Elsewhere
The Lives of Others: Open-Source Development Practices ElsewhereThe Lives of Others: Open-Source Development Practices Elsewhere
The Lives of Others: Open-Source Development Practices Elsewhere
 

Recently uploaded

WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceSamy Fodil
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!Memoori
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...panagenda
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024Lorenzo Miniero
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireExakis Nelite
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfFIDO Alliance
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingScyllaDB
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxFIDO Alliance
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...FIDO Alliance
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...ScyllaDB
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?Paolo Missier
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...marcuskenyatta275
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimaginedpanagenda
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctBrainSell Technologies
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Hiroshi SHIBATA
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessUXDXConf
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 

Recently uploaded (20)

WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 

PostgreSQL and XML

  • 1. PostgreSQL and XML Peter Eisentraut petere@postgresql.org Prague PostgreSQL Developers’ Day 2008
  • 2. Current Developments Future Developments Use Cases Conclusion Outline 1 Current Developments 2 Future Developments 3 Use Cases 4 Conclusion
  • 3. Current Developments Future Developments Use Cases Conclusion Outline 1 Current Developments 2 Future Developments 3 Use Cases 4 Conclusion
  • 4. Current Developments Future Developments Use Cases Conclusion New Features Available in PostgreSQL 8.3: XML Data Type XML Publishing XML Export SQL:2003 conformance XPath
  • 5. Current Developments Future Developments Use Cases Conclusion XML Data Type Outline 1 Current Developments XML Data Type XML Publishing XML Export XPath 2 Future Developments DTD and XML Schema validation Annotated schema decomposition XSLT Performance Issues Full-Text Search Advanced Indexing More Ideas 3 Use Cases 4 Conclusion
  • 6. Current Developments Future Developments Use Cases Conclusion XML Data Type XML Data Type CREATE TABLE test ( ..., data xml, ... ); Features: Input checking Support functions Issues: Internal storage format (plain text) Encoding handling
  • 7. Current Developments Future Developments Use Cases Conclusion XML Data Type Using the XML Type Bizarre SQL way: INSERT INTO test VALUES ( ..., XMLPARSE (DOCUMENT ’<foo>...</foo>’), ... ); SELECT XMLSERIALIZE (DOCUMENT data AS varchar) FROM test;
  • 8. Current Developments Future Developments Use Cases Conclusion XML Data Type Using the XML Type Bizarre SQL way: INSERT INTO test VALUES ( ..., XMLPARSE (DOCUMENT ’<foo>...</foo>’), ... ); SELECT XMLSERIALIZE (DOCUMENT data AS varchar) FROM test; Simple PostgreSQL way: INSERT INTO test VALUES (... , ’<foo>...</foo>’, ...); SELECT data FROM test;
  • 9. Current Developments Future Developments Use Cases Conclusion XML Data Type XML Type Oddities No comparison operators To retrieve, use: Cast to text, or XPath, or Other key column To index, use: Cast to text, or XPath
  • 10. Current Developments Future Developments Use Cases Conclusion XML Publishing Outline 1 Current Developments XML Data Type XML Publishing XML Export XPath 2 Future Developments DTD and XML Schema validation Annotated schema decomposition XSLT Performance Issues Full-Text Search Advanced Indexing More Ideas 3 Use Cases 4 Conclusion
  • 11. Current Developments Future Developments Use Cases Conclusion XML Publishing Producing XML Content The old way? SELECT ’<record id="’ || id || ’"><value>’ || ad_hoc_escape_func(value) || ’</value></record>’ FROM tab;
  • 12. Current Developments Future Developments Use Cases Conclusion XML Publishing Producing XML Content The old way? SELECT ’<record id="’ || id || ’"><value>’ || ad_hoc_escape_func(value) || ’</value></record>’ FROM tab; The new way: SELECT XMLELEMENT(NAME record, XMLATTRIBUTES(id), XMLELEMENT(NAME value, value)) FROM tab;
  • 13. Current Developments Future Developments Use Cases Conclusion XML Publishing XMLELEMENT Example SQL: XMLROOT ( XMLELEMENT ( NAME ’gazonk’, XMLATTRIBUTES ( ’val’ AS ’name’, 1 + 1 AS ’num’ ), XMLELEMENT ( NAME ’qux’, ’foo’ ) ), VERSION ’1.0’, STANDALONE YES )
  • 14. Current Developments Future Developments Use Cases Conclusion XML Publishing XMLELEMENT Example SQL: Result: XMLROOT ( <?xml version=’1.0’ XMLELEMENT ( standalone=’yes’ ?> NAME ’gazonk’, <gazonk name=’val’ XMLATTRIBUTES ( num=’2’> ’val’ AS ’name’, <qux>foo</qux> 1 + 1 AS ’num’ </gazonk> ), XMLELEMENT ( NAME ’qux’, ’foo’ ) ), VERSION ’1.0’, STANDALONE YES )
  • 15. Current Developments Future Developments Use Cases Conclusion XML Publishing XMLFOREST Example SELECT xmlforest ( "FirstName" as "FName", "LastName" as "LName", ’string’ as "str", "Title", "Region" ) FROM "Demo"."demo"."Employees"; might result in <FName>Nancy</FName> <LName>Davolio</LName> <str>string</str> <Title>Sales Representative</Title> <Region>WA</Region> . . . <FName>Anne</FName> <LName>Dodsworth</LName> <str>string</str> <Title>Sales Representative</Title> (1 row per record)
  • 16. Current Developments Future Developments Use Cases Conclusion XML Publishing XMLAGG Example SELECT xmlelement (’Emp’, xmlattributes (’Sales Representative’ as "Title"), xmlagg (xmlelement (’Name’, "FirstName", ’ ’, "LastName"))) FROM "Demo"."demo"."Employees" WHERE "Title" = ’Sales Representative’; might result in <Emp Title="Sales Representative"> <Name>Nancy Davolio</Name> <Name>Janet Leverling</Name> <Name>Margaret Peacock</Name> <Name>Michael Suyama</Name> <Name>Robert King</Name> <Name>Anne Dodsworth</Name> </Emp> (1 row)
  • 17. Current Developments Future Developments Use Cases Conclusion XML Export Outline 1 Current Developments XML Data Type XML Publishing XML Export XPath 2 Future Developments DTD and XML Schema validation Annotated schema decomposition XSLT Performance Issues Full-Text Search Advanced Indexing More Ideas 3 Use Cases 4 Conclusion
  • 18. Current Developments Future Developments Use Cases Conclusion XML Export XML Export Map table/schema/database contents to XML document Map table/schema/database schema to XML Schema Useful for: Downstream processing (e.g., SOAP, web services) Postprocessing using XSLT Backup??? Display formats (alternative to psql’s HTML mode)
  • 19. Current Developments Future Developments Use Cases Conclusion XML Export XML Export Functions Data export: table_to_xml(tbl regclass, nulls boolean, tableforest boolean, targetns text) query_to_xml(query text, nulls boolean, tableforest boolean, targetns text) cursor_to_xml(cursor refcursor, count int, nulls boolean, tableforest boolean, targetns text) Schema export: table_to_xmlschema(tbl regclass, nulls boolean, tableforest boolean, targetns text) query_to_xmlschema(query text, nulls boolean, tableforest boolean, targetns text) cursor_to_xmlschema(cursor refcursor, nulls boolean, tableforest boolean, targetns text)
  • 20. Current Developments Future Developments Use Cases Conclusion XML Export XML Schema Mapping Example CREATE TABLE test (a int PRIMARY KEY, b varchar(200)); is mapped to <xsd:complexType name="RowType.catalog.schema.test"> <xsd:sequence> <xsd:element name="a" type="INTEGER"></xsd:element> <xsd:element name="b" type="VARCHAR_200_200" minOccurs="0"></xsd:element> </xsd:sequence> </xsd:complexType> <xsd:complexType name="TableType.catalog.schema.test"> <xsd:sequence> <xsd:element name="row" type="RowType.catalog.schema.test" minOccurs="0" maxOccurs="unbounded" /> </xsd:sequence> </xsd:complexType>
  • 21. Current Developments Future Developments Use Cases Conclusion XML Export XML Export Format Example <catalogname> <schemaname> <tablename> <row> <colname1>value</colname1> <colname2 xsi:nil=’true’/> ... </row> ... </tablename> ... </schemaname> ... </catalogname>
  • 22. Current Developments Future Developments Use Cases Conclusion XPath Outline 1 Current Developments XML Data Type XML Publishing XML Export XPath 2 Future Developments DTD and XML Schema validation Annotated schema decomposition XSLT Performance Issues Full-Text Search Advanced Indexing More Ideas 3 Use Cases 4 Conclusion
  • 23. Current Developments Future Developments Use Cases Conclusion XPath XPath example Example table: CREATE TABLE table1( id integer PRIMARY KEY, created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, xdata xml );
  • 24. Current Developments Future Developments Use Cases Conclusion XPath XPath Example Example data: INSERT INTO table1 (id, xdata) VALUES( 1, ’<dept xmlns:smpl="http://example.com" smpl:did="DPT011-IT"> <name>IT</name> <persons> <person smpl:pid="111"> <name>John Smith</name> <age>24</age> </person> <person smpl:pid="112"> <name>Michael Black</name> <age>28</age> </person> </persons> </dept>’ );
  • 25. Current Developments Future Developments Use Cases Conclusion XPath XPath Example Simple example query: SELECT * FROM table1 WHERE (xpath(’//person/name/text()’, xdata))[1]::text = ’John Smith’; And using namespaces: SELECT * FROM table1 WHERE (xpath(’//person/@smpl:pid’, xdata, ARRAY[ARRAY[’smpl’, ’http://example.com’]]))::text = ’111’;
  • 26. Current Developments Future Developments Use Cases Conclusion XPath XPath: Indexes Use functional indexes to avoid XPath evaluation at run time: CREATE INDEX i_table1_xdata ON table1 USING btree ( xpath(’//person/@name’, xdata) );
  • 27. Current Developments Future Developments Use Cases Conclusion Outline 1 Current Developments 2 Future Developments 3 Use Cases 4 Conclusion
  • 28. Current Developments Future Developments Use Cases Conclusion Future Developments DTD and XML Schema validation Annotated schema decomposition XSLT Performance issues Full-text search Advanced indexing (XLABEL) More, more, more
  • 29. Current Developments Future Developments Use Cases Conclusion DTD and XML Schema validation Outline 1 Current Developments XML Data Type XML Publishing XML Export XPath 2 Future Developments DTD and XML Schema validation Annotated schema decomposition XSLT Performance Issues Full-Text Search Advanced Indexing More Ideas 3 Use Cases 4 Conclusion
  • 30. Current Developments Future Developments Use Cases Conclusion DTD and XML Schema validation DTD and XML Schema validation DTD validation: Implemented for 8.3, DTD is passed by URI Should be extended to allow passing DTD as text XML Schema (XSD) validation (XMLVALIDATE per SQL:2006): INSERT INTO messages(msg) SELECT xmlvalidate( DOCUMENT ’<?xml ...’ ACCORDING TO XMLSCHEMA NO NAMESPACE LOCATION ’http://mycompany.com/msg-schema’ ); (The result of XMLVALIDATE is a new XML value.)
  • 31. Current Developments Future Developments Use Cases Conclusion Annotated schema decomposition Outline 1 Current Developments XML Data Type XML Publishing XML Export XPath 2 Future Developments DTD and XML Schema validation Annotated schema decomposition XSLT Performance Issues Full-Text Search Advanced Indexing More Ideas 3 Use Cases 4 Conclusion
  • 32. Current Developments Future Developments Use Cases Conclusion Annotated schema decomposition Annotated schema decomposition In some cases decomposition of XML Schema to relational data is better (no storing XML data, XML serves as transport only): When we need to store only small parts of the XML data Already developed tools might be designed only for relational data During decomposition the following capabilities could be used: Data normalization Foreign keys creation Conditional insertion of data chunks Insert parts of initial XML document as XML values
  • 33. Current Developments Future Developments Use Cases Conclusion XSLT Outline 1 Current Developments XML Data Type XML Publishing XML Export XPath 2 Future Developments DTD and XML Schema validation Annotated schema decomposition XSLT Performance Issues Full-Text Search Advanced Indexing More Ideas 3 Use Cases 4 Conclusion
  • 34. Current Developments Future Developments Use Cases Conclusion XSLT XSLT The easiest way: adapt and expand contrib/xml2’s capabilities. Choose an approach: Move XSLT functionality to the core (and use --with-libxslt) Separate contrib/xslt
  • 35. Current Developments Future Developments Use Cases Conclusion XSLT XSLT Crazy idea: PL/XSLT Define transformations as functions Version 0.0.0 exists :-)
  • 36. Current Developments Future Developments Use Cases Conclusion Performance Issues Outline 1 Current Developments XML Data Type XML Publishing XML Export XPath 2 Future Developments DTD and XML Schema validation Annotated schema decomposition XSLT Performance Issues Full-Text Search Advanced Indexing More Ideas 3 Use Cases 4 Conclusion
  • 37. Current Developments Future Developments Use Cases Conclusion Performance Issues Performance Issues Ideas: Cache intermediate results to avoid redundant parsing and XPath evaluation Advanced physical storage to speedup access to arbitrary node in XML data Use PostgreSQL existing capabilities for full-text search Use additional structures/tables/indexes to avoid XPath evaluation at runtime Use slices (similar to array_extract_slice()) to avoid dealing with entire values (both in SELECT and UPDATE)
  • 38. Current Developments Future Developments Use Cases Conclusion Full-Text Search Outline 1 Current Developments XML Data Type XML Publishing XML Export XPath 2 Future Developments DTD and XML Schema validation Annotated schema decomposition XSLT Performance Issues Full-Text Search Advanced Indexing More Ideas 3 Use Cases 4 Conclusion
  • 39. Current Developments Future Developments Use Cases Conclusion Full-Text Search Full-Text Search Simple way to create FTS index (available in 8.3): CREATE INDEX i_table1_fts ON table1 USING gist ( to_tsvector( ’default’, array_to_string(xpath(’//text()’, xdata), ’ ’) ) );
  • 40. Current Developments Future Developments Use Cases Conclusion Full-Text Search Full-Text Search Proposal for overloading of built-in to_tsvector(): CREATE OR REPLACE FUNCTION to_tsvector(text, xml) RETURNS tsearch2.tsvector LANGUAGE SQL IMMUTABLE AS $$ SELECT to_tsvector( $1, array_to_string(xpath(’//text()’, $2), ’ ’) ); $$; CREATE INDEX i_table1_fts ON table1 USING gist (to_tsvector(’default’, xdata));
  • 41. Current Developments Future Developments Use Cases Conclusion Full-Text Search Full-Text Search Further ideas for full-text search: Indexing parts of documents (available in 8.3, in some way) Element names in tsvector Relevance scoring (ranking) FTS parser for XML
  • 42. Current Developments Future Developments Use Cases Conclusion Advanced Indexing Outline 1 Current Developments XML Data Type XML Publishing XML Export XPath 2 Future Developments DTD and XML Schema validation Annotated schema decomposition XSLT Performance Issues Full-Text Search Advanced Indexing More Ideas 3 Use Cases 4 Conclusion
  • 43. Current Developments Future Developments Use Cases Conclusion Advanced Indexing XLABEL Idea: Enumerate all XML node names in one database-wide table (xnames) Store shredded data in additional table (columnname_xlabel) Use numbering scheme to encode nodes (e.g., ltree) Use GiST/GIN indexes for numbering scheme column Rewrite XPath expression to plain SQL statement Implement partial updates support to avoid massive index rebuilding
  • 44. Current Developments Future Developments Use Cases Conclusion Advanced Indexing XLABEL Enumerate all XML node names in the database: Table: xnames xname_id xname_name 1 person 2 dept 3 name 4 did 5 persons ... ...
  • 45. Current Developments Future Developments Use Cases Conclusion Advanced Indexing XLABEL For an XML column implicitly create additional table (using xlabel.register_column() function): Table: table1_xdata tid xlabel node_type xname_id value 1 a 1 (elem.) 2 NULL 1 a.b 2 (attr.) 4 DPT011-IT 1 a.c 1 (elem.) 3 NULL 1 a.c.a NULL NULL IT ... ... ... ... ... 1 a.d.a.b 1 (elem.) 3 NULL 1 a.d.a.b.a NULL NULL John Smith ... ... ... ... ... CREATE INDEX i_table1_xdata_xlabel ON table1_xdata USING gist (xlabel);
  • 46. Current Developments Future Developments Use Cases Conclusion Advanced Indexing XLABEL Rewrite XPath expression to plain SQL statement: SELECT * FROM table1 WHERE array_dims(xpath(’//person/name’, xdata)) IS NOT NULL; . . . becomes . . . SELECT * FROM table1 WHERE EXISTS( SELECT 1 FROM table1_xdata AS t1, table1_xdata AS t2 WHERE t1.xname_id = 1 AND t2.xname_id = 3 AND t3.xlabel <@ t1.xlabel ); . . . where <@ means “is a child of”.
  • 47. Current Developments Future Developments Use Cases Conclusion Advanced Indexing XLABEL Current thoughts: Separate table is problematic (déjà vu: fti vs. tsearch2) It would be great if one structure solves 2 problems at once: access to arbitrary node SELECTs with XPath
  • 48. Current Developments Future Developments Use Cases Conclusion More Ideas Outline 1 Current Developments XML Data Type XML Publishing XML Export XPath 2 Future Developments DTD and XML Schema validation Annotated schema decomposition XSLT Performance Issues Full-Text Search Advanced Indexing More Ideas 3 Use Cases 4 Conclusion
  • 49. Current Developments Future Developments Use Cases Conclusion More Ideas More, more, more Inline ORDER BY for XMLAGG (SQL:2003) ... XMLAGG(XMLELEMENT(...) ORDER BY col1) ... XMLCAST (SQL:2006) XML Canonical Pretty-printing XML Registered XML Schemas (SQL:2006) Schema evolution Improve Data Model (XDM) XQuery support (SQL:2006) Updatable XML views (over relational data) Relax-NG validation
  • 50. Current Developments Future Developments Use Cases Conclusion More Ideas And even more! Bulk loader for XML data (parallelize the XML parsing) XML-awareness in APIs and PLs Additional contribs/projects (web services, ODF, DocBook utilities, etc.) New tools and applications, integration with existing ones
  • 51. Current Developments Future Developments Use Cases Conclusion Outline 1 Current Developments 2 Future Developments 3 Use Cases 4 Conclusion
  • 52. Current Developments Future Developments Use Cases Conclusion Use Cases Use Case 1: Document Management System Use Case 2: Store Logs in the Database Use Case 3: Heterogeneous Catalog
  • 53. Current Developments Future Developments Use Cases Conclusion Use Case 1: Document Management System The primary goal: to store documents in the RDBMS as is
  • 54. Current Developments Future Developments Use Cases Conclusion Use Case 2: Store Logs in the Database Table: action action_id SERIAL action_type_id INT4 action_status_id INT4 action_person_id INT4 action_data XML The primary goal: to achieve flexibility, avoid database schema changes (schema evolution)
  • 55. Current Developments Future Developments Use Cases Conclusion Use Case 3: Heterogeneous Catalog Task: to build heterogeneous catalog (items of different types, a lot of properties)
  • 56. Current Developments Future Developments Use Cases Conclusion Use Case 3: Heterogeneous Catalog Task: to build heterogeneous catalog (items of different types, a lot of properties) How?
  • 57. Current Developments Future Developments Use Cases Conclusion Use Case 3: Heterogeneous Catalog Ugly way
  • 58. Current Developments Future Developments Use Cases Conclusion Use Case 3: Heterogeneous Catalog Entity-Attribute-Value model
  • 59. Current Developments Future Developments Use Cases Conclusion Use Case 3: Heterogeneous Catalog Semi-structured data approach
  • 60. Current Developments Future Developments Use Cases Conclusion Use Case 3: Heterogeneous Catalog Metadata Query Interface for Heterogeneous Data Archives (International Virtual Observatory): http://alcor.sao.ru/php/search/
  • 61. Current Developments Future Developments Use Cases Conclusion Outline 1 Current Developments 2 Future Developments 3 Use Cases 4 Conclusion
  • 62. Current Developments Future Developments Use Cases Conclusion Credits J. Gray et al. for contrib/xml2 Pavel Stehule for initial patch for SQL/XML publishing functions Nikolay Samokhvalov for Google Summer of Code 2006 project and part of this presentation me :-) PostgreSQL developer community for fixing our bugs
  • 63. Current Developments Future Developments Use Cases Conclusion More Information SQL:2006, Part 14: XML-Related Specifications PostgreSQL documentation XML Development Wiki Page: http://developer.postgresql.org/index.php/XML_Support N. Samokhvalov, “XML Support in PostgreSQL”, Proceedings of SYRCoDIS, Moscow, Russia, 2007, http://samokhvalov.com/syrcodis2007.ps pgsql-hackers@postgresql.org