473,287 Members | 1,643 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

mySQL C API vector binding support?

Hello,
I have a "slight" problem with the mySQL C API. I want to bind vectors
for output/input prepared statements. However, the C API does NOT
support such data binding. Is there ANY other way to do a
bulk-INSERT/DELETE/UPDATE or bulk-SELECT in mySQL C API? I mean, one
can do it with a loop, but obiously the goal is to have a higher
performance.I tried it with a plain-old loop, but it is still slow.
Oracle supports such feature and it is considerably faster than the
usual loop-Insert (appr. 100 times faster for big queries) ! ! !
Please, advise.

Thanx.

Regards,

Dragomir Stanchev

Sep 25 '06 #1
1 4787
The|Godfather wrote:
Hello,
I have a "slight" problem with the mySQL C API. I want to bind vectors
for output/input prepared statements. However, the C API does NOT
support such data binding. Is there ANY other way to do a
bulk-INSERT/DELETE/UPDATE or bulk-SELECT in mySQL C API? I mean, one
can do it with a loop, but obiously the goal is to have a higher
performance.I tried it with a plain-old loop, but it is still slow.
Oracle supports such feature and it is considerably faster than the
usual loop-Insert (appr. 100 times faster for big queries) ! ! !
Please, advise.

Thanx.

Regards,

Dragomir Stanchev
Hi,
I seemed to found a partial solution to MY problem. However it works
only with INSERT.

When you want to add to your mySQL database many vectorS of elements or
other array-style things using prepared quires under mySQL C API you
can do it in 2 ways:
--->
The following tests were conducted using an array of 3000 vectors ,
each holding 100 elements of type int.
--->
1. Insert elements one by one. Obivous solution, but VERY
slowwww. For 300 000 elements (integers) it takes the staggering ~38
minutes doing INSERT to a remote ( not local) server.

2. The solution I used: just parse the Prepared query and instead
of:
"INSERT INTO tableName values()"
DO
"INSERT INTO tableName values(),(),(),().......(n) " ,

where n is vector<>.size() or whatever. Note that usually it is advised
to use a vector of size 100 elements cause it is the most efficient.
THE efficiency gain: ~15 seconds total time for the same 300 000
queries and the same remote mySQL server.
Just out of curiosity I testet the Oracle OCI integrated array
insertion mechanism and it turns out that Oracle was slower : ~19
seconds for 300 000 elements , 100 elements per one bulk insert.

Note: I tried to optimize it for UPDATE or/and DELETE but no success so
far. Any suggestions would be welcome.

Cheers,
Dragomir Stanchev

Oct 17 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Scott Bates | last post by:
I am attempting to create a JAXB Object that returns the CollectionType as a List. In my schema file, I used the following: <jxb:globalBindings> collectionType="java.util.Vector"...
5
by: sandy | last post by:
Hi All, I am a newbie to MySQL and Python. At the first place, I would like to know what are the general performance issues (if any) of using MySQL with Python. By performance, I wanted to...
0
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest...
74
by: John Wells | last post by:
Yes, I know you've seen the above subject before, so please be gentle with the flamethrowers. I'm preparing to enter a discussion with management at my company regarding going forward as either...
3
by: JJ | last post by:
I am a newbie to mySQL. I am developing an ASP .net Web site with mySQL as the database (of products), using vb .net 2003. Can anyone point me in the direction of a good book (or in fact ANY book)...
3
by: TS | last post by:
when binding to a datagrid for example, is it possible to use databinding syntax to bind to a property of a property? Say the datasource="Cars" which is a collection of car classes and the...
9
by: Chris Roth | last post by:
I have a vector of vectors: vector< vector<double v; and have initialized it with: v( 5 ); as I know I will have 5 columns of data. At this point, I read text file data into each of the the...
5
by: star-italia | last post by:
My XAML is the following: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Style...
6
by: Tomasz J | last post by:
Hello developers, I bind my TextBox control specyfying a format stored in my application global ApplicationContext object - it has a static string CurrencyFormat property. The problem - this...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.