1 Reply Latest reply: Jan 27, 2011 3:20 AM by 655560 RSS

    Why adding a large document is so slow

    834661
      all:
      please help me.
      it spend about 6 minustes or more when i add a XML document into container. the size of file is about 50M.
      my codes are here:

      const char *path2DbEnv = 0;
      u_int32_t envFlags = DB_CREATE|DB_PRIVATE|DB_INIT_MPOOL;
      u_int32_t envCacheSize = 64*1024*1024;
      DB_ENV *dbEnv;
      db_env_create(&dbEnv, 0);
      dbEnv->set_cachesize(dbEnv, 0, envCacheSize, 1);
      dberr = dbEnv->open(dbEnv, path2DbEnv, envFlags, 0);

      XmlManager xmlManager(dbEnv, DBXML_ADOPT_DBENV);
      XmlContainer xmlContainer = xmlManager.createContainer("CIM.dbxml");

      XmlDocument document = xmlManager.createDocument();
      document.setName("test");
      XmlInputStream *theStream = xmlManager.createLocalFileInputStream("myXMLFile.xml");
      document.setContentAsXmlInputStream(theStream);

      XmlUpdateContext updateContext = xmlManager.createUpdateContext();
      xmlContainer.putDocument(document,updateContext);
        • 1. Re: Why adding a large document is so slow
          655560
          Hi,

          Since the XML document is about 50M. Please try turning autoIndexing off and only set indexes as needed:
          http://download.oracle.com/docs/cd/E17276_01/html/api_reference/CXX/XmlContainer_setAutoIndexing.html

          Also: if possible, try to enlarge the cache size (128M, 256M, etc) to see if it can help the performance.

          Best regards,
          Rucong
          Oracle Berkeley DB XML