473,698 Members | 2,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4803
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
6656
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" </jxb:globalBindings> This changed the initialization in the impl stub from the following: protected com.sun.xml.bind.util.ListImpl _MyList = new
5
4679
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 know how will the speed be, what is the memory overhead involved, etc during database specific operations (retrieval, update, insert, etc) when MySQL is used with Python.
0
3943
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 version of this document can be found at: http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download
74
8003
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 a MySql shop or a Postgresql shop. It's my opinion that we should be using PG, because of the full ACID support, and the license involved. A consultant my company hired before bringing me in is pushing hard for MySql, citing speed and community...
3
1413
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) on using mySQL with asp .net ?? I am having trouble working out: 1. What type of connector to use to my database (i.e. ODBC or mySQL's .net Connector)? 2. Whether it is advised to bind you data to the web controls (e.g. datagrid). I've read...
3
2154
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 DataValueField = "Driver.Name" which is the Car.Driver property and then the Driver.Name property. thanks
9
2602
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 vectors using push_back. I know that I will be reading in 5000 elements into each vector, so I use reserve: ifstream f( "file.txt" ); if(f.is_open()) {
5
2365
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 x:Key="ButtonStyle" TargetType="{x:Type Button}"> <Setter Property="OverridesDefaultStyle" Value="True" /> <Setter Property="SnapsToDevicePixels" Value="True" /> <Setter Property="FontSize" Value="16" /> <Setter Property="Template"> <Setter.Value>
6
4599
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 works fine: Text='<%# Eval("Price", ApplicationContext.CurrencyFormat) %>'
0
8674
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9028
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4369
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.