[basex-talk] Fw: Increase Performence

2014-05-29 Thread ChandraSekhar


Dear Team

   I have collection in gb's ,so I am sending one sample 
xml along with query.Please give me the tips for performance and please do 
the need full.



Thanks  Regards
Chandra Sekhar


-Original Message- 
From: Christian Grün

Sent: Wednesday, May 28, 2014 1:29 PM
To: ChandraSekhar
Subject: Re: Reg : Increase Performence

Hi Chandra,

we clearly need more information to give you hints. Did you e.g. check
out the query compilation on the InfoView?

Best,
Christian

PS: To get more information, please write to the basex-talk mailing list.



On Wed, May 28, 2014 at 8:12 AM, ChandraSekhar
chandrasekha...@intense.in wrote:

Dear Chirstian

Earlier we are using 6.7 version now we are
migrating this into the latest version,compare to the 6.7 and 7.8.2,In
latest version performance was very high.
But when my collections are in GB'S(we are running the
query's on multiple collections) .Its taking long time and consuming 
memory.

Is there any solution that we can handle like this cases.


Thanks  Regards
Chandra Sekhar

--
This message is for the intended recipient only. If you are not the
intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of the
information is strictly prohibited.
__ 


--
This message is for the intended recipient only. If you are not the intended 
recipient you are notified that disclosing, copying, distributing or taking any 
action in reliance on the contents of the information is strictly prohibited.
__


DOCUMENT{
let $doc :=
(collection(000572517_SEPTEMBER_13_1_AAAfB1AAEAAAjlUAAB)//CONN[@NO =
(9878727704)]/../ITEMIZED/TRANSACTION[@Type = ATamp;T 800
Global]/CALL_TYPES/DATA/R)
for $data in $doc
let $groupByValue1 := data($data/C2)
group by $groupByValue1
order by $groupByValue1
return
R{
 Usage_Type_Id {distinct-values(data($data/C2))}/Usage_Type_Id,
 No_of_calls {count(data($data/C2))}/No_of_calls,
 Total_minutes {sum(data($data/C9))}/Total_minutes,
 Total_Amount {sum(data($data/C10))}/Total_Amount,
 Discount {sum(data($data/C11))}/Discount,
 Dis_Percent {100*sum(data($data/C11)) div
sum(data($data/C10))}/Dis_Percent,
 Net_Amount {sum(data($data/C10))+sum(data($data/C11))}/Net_Amount,
 AvgAmt_per_call {(sum(data($data/C10))+sum(data($data/C11))) div
sum(data($data/C9))}/AvgAmt_per_call,Average_duration
{sum(data($data/C9)) div count(data($data/C2))}/Average_duration
}/R
}/DOCUMENT
?xml version=1.0 encoding=ISO-8859-1 standalone=yes ?
SUBCUSTBRKCONN NO=240455/CONN
AccNo NO=000596056/AccNo
DETAILTRANSACTION Type=ATamp;T SDS GSDS Calls=1 Units=1
Amt=0.79000H1ATamp;T SDS GSDS/H1
H2C1 DT=TextCall Charges/C1
C2 DT=TextRate Period/C2
C3 DT=NumberNo.of Calls/C3
C4 DT=NumberUnits/C4
C5 DT=MoneyR.O/C5
/H2
SUB_SECTION Type=Larga Distancia Nacional RP=0 Calls=1 Units=1
Amt=.79/SUB_SECTION/TRANSACTION
TRANSACTION Type=ATamp;T 800 Calls=2 Units=7
Amt=5.53000H1ATamp;T 800/H1
H2C1 DT=TextCall Charges/C1
C2 DT=TextRate Period/C2
C3 DT=NumberNo.of Calls/C3
C4 DT=NumberUnits/C4
C5 DT=MoneyR.O/C5
/H2
SUB_SECTION Type=Larga Distancia Nacional RP=0 Calls=2 Units=7
Amt=5.53/SUB_SECTION/TRANSACTION
TRANSACTION Type=ATamp;T 800 Global Calls=1 Units=4
Amt=3.16000H1ATamp;T 800 Global/H1
H2C1 DT=TextCall Charges/C1
C2 DT=TextRate Period/C2
C3 DT=NumberNo.of Calls/C3
C4 DT=NumberUnits/C4
C5 DT=MoneyR.O/C5
/H2
SUB_SECTION Type=Larga Distancia Nacional RP=0 Calls=1 Units=4
Amt=3.16/SUB_SECTION/TRANSACTION
TRANSACTION Type=ATamp;T Larga Distancia Calls=1 Units=1
Amt=0.79000H1ATamp;T Larga Distancia/H1
H2C1 DT=TextCall Charges/C1
C2 DT=TextRate Period/C2
C3 DT=NumberNo.of Calls/C3
C4 DT=NumberUnits/C4
C5 DT=MoneyR.O/C5
/H2
SUB_SECTION Type=Larga Distancia Nacional RP=0 Calls=1 Units=1
Amt=.79/SUB_SECTION/TRANSACTION
TRANSACTION Type=ATamp;T Servicio Local Calls=1 Units=2
Amt=1.58000H1ATamp;T Servicio Local/H1
H2C1 DT=TextCall Charges/C1
C2 DT=TextRate Period/C2
C3 DT=NumberNo.of Calls/C3
C4 DT=NumberUnits/C4
C5 DT=MoneyR.O/C5
/H2
SUB_SECTION Type=Larga Distancia Nacional RP=0 Calls=1 Units=2
Amt=1.58/SUB_SECTION/TRANSACTION
TRANSACTION Type=ATamp;T Global Conference Calls=1 Units=1
Amt=0.79000H1ATamp;T Global Conference/H1
H2C1 DT=TextCall Charges/C1
C2 DT=TextRate Period/C2
C3 DT=NumberNo.of Calls/C3
C4 DT=NumberUnits/C4
C5 DT=MoneyR.O/C5
/H2
SUB_SECTION Type=Larga Distancia Nacional RP=0 Calls=1 Units=1
Amt=.79/SUB_SECTION/TRANSACTION
/DETAIL
ITEMIZEDTRANSACTION Type=ATamp;T SDS GSDSCALL_TYPES TYPE=Larga
Distancia NacionalH1Larga Distancia Nacional/H1
H2C1 DT=NumberMobileNo/C1
C2 DT=TextUsage_Type_Id/C2
C3 DT=NumberExternal_Id/C3
C4 DT=NumberExternal_Id_Type/C4
C5 DT=NumberBill_Class/C5
C6 DT=NumberJurisdiction/C6
C7 DT=NumberOrigin_num/C7
C8 DT=NumberTarget_num/C8
C9 DT=NumberPrimary_Units/C9
C10 DT=MoneyAmount/C10
C11 DT=MoneyDiscount/C11
C12 DT=DateTransaction_Date/C12
C13 DT=TextRate_Period/C13
C14 DT=NumberAuthorization_Code/C14
C15 DT=NumberAccount_Code/C15

Re: [basex-talk] [FORG0006] Unknown method:

2014-05-29 Thread Erol Akarsu
Christian,

I tried to close prepared statement and got this exception:

[BXSQ0002] No opened connection with id 1

It throws exception at line

let $clres := sql:close($prep)


 let $prep := sql:prepare($conn,$sqlStmt)
let $params := sql:parameters
 sql:parameter type='string'{$useType}/sql:parameter
   /sql:parameters
let $result := sql:execute-prepared($prep, $params)
let $clres := sql:close($prep)




On Wed, May 28, 2014 at 3:51 PM, Christian Grün christian.gr...@gmail.com
wrote:

  sql:close is for connection to SQL server but prepared statement?

 If I remember right, it's for both. Did you have a try?



Re: [basex-talk] USPTO XML format causes BaseX GUI errors

2014-05-29 Thread Jose Rey
Christian, beautiful. It worked pretty well.


On Sun, Apr 27, 2014 at 1:19 PM, Christian Grün christian.gr...@gmail.com
wrote:

 Hi Jose,

 your .xml file actually contains several XML files, which must first be
 split in order to be parsed. I’ve attached one solution in XQuery (there
 may be other, more elegant solutions):

   (: open file :)
   let $input := unparsed-text('ipgb20110104Sample.xml')
   (: get document substrings; omit those without angle brackets :)
   let $docs := tokenize($input, '\?xml version=1.0
 encoding=UTF-8\?\s*!DOCTYPE us-patent-grant SYSTEM
 us-patent-grant-v42-2006-08-23.dtd \[ \]\s*')[matches(., '')]
   (: generate document names :)
   let $names :=
 for $n in 1 to count($docs)
 return $n || '.xml'
   (: create database with all documents :)
   return db:create('db', $docs, $names)

 Hope this helps,
 Christian




 On Sun, Apr 27, 2014 at 6:52 PM, Jose Rey only...@gmail.com wrote:

 Hi,

 I am new to BaseX and will attempt to use it to analyze xml datasets from
 R at some point in the near future. I am using a BaseX GUI under Windows-7
 operating system and had an error while trying to create a database using
 the GUI by using an XML file as input. The file comes from the US Patents
 and Trademarks Office (USPTO), and the larger XML datasets they provide
 have the same problem.

 The error text is:

 Command:
 CREATE DB ipgb20110104Sample 
 C:/Users/admin/Downloads/ipgb20110104Sample.xmlError:C:/Users/admin/Downloads/ipgb20110104Sample.xml
  (Line 306): The processing instruction target matching [xX][mM][lL] is 
 not allowed.


 The XML document I am trying to open is contained in this zip file:
 http://www.uspto.gov/products/ipgb110104-sample.zip

 The link to the document is in this page:
 http://www.uspto.gov/products/xml-resources.jsp
 under the Patent Grant Data / XML ST. 36 (ICE) v4.2 (a.k.a. Red Book)
 (2007 - 2012) section of the page, under the Sample Documents
 (Bibliographic) bulletpoint


 From searching online, I found that the error is because of poor
 formatting in the file. However, larger datasets of the same kind (USPTO
 bulk download @ Google) have the same problem. In the specific case of the
 file I mention, it has a carriage return in the first line, and then has
 several concatenated XML files, which is the case of the larger XML files
 from the USPTO.

 My question is:

 Is there a work around to this error/problem? Can I somehow tell BaseX to
 ignore or somehow acknowledge that mistake and load the file(s).

 Thank you so much,

 Jose

 --
 Jose I. Rey
 only...@gmail.com





-- 
Jose I. Rey
only...@gmail.com