<div dir="ltr">This makes me think of a feature request ( unless its already there then I would love to use it). I would love a mechanism that through the C++ ADK that I could write a plug-in for the server. The idea being a database licensor would ship a plug-in with the server that provides one or more "user" functions/procedures that the client can then call. When the client calls this function, the server would hand it off to the plug-in which could do what it needed to the active database through ADK API calls allowing quick powerful functionality and centralized logic.<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Nov 16, 2013 at 10:09 AM, Chris Jones <span dir="ltr"><<a href="mailto:cjones@daz3d.com" target="_blank">cjones@daz3d.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Inserting many items is fine seems to be fine but because of the exception I need to make sure the items are not there before I need to add them. Thinking about this I thought I would just make a simple user function that checked to see if the item was there and returned its RecID if it was, or inserted it and then returned the new rec id. I could then send a select/execute that executes a bunch of these at once and minimize the traffic between client and server.<br>
<br></div>However, I got some weird results testing this plan in Valentina Studio. First, this is all done on local host, so latency is not as big an issue as it could be. However our users all use this database on localhost too, so this is the correct enviroment. The simple query I was executing in the user function took 100s of milliseconds while just doing the check query only takes about a 1 ms. Furthermore, if calling the function actually resulted in inserting an item into the table future calls to that function took full seconds to execute. I did find that if later in the session I called "Commit" the function returned to its normal execution time, but in all it seems this takes longer than executing a query followed by an insert if it is needed. Are user functions usually this slow? It seemed like a very simple function: a query, and an if that returns the query result or inserts and returns the last record id for that table.<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Sat, Nov 16, 2013 at 1:30 AM, Ivan Smahin <span dir="ltr"><<a href="mailto:ivan_smahin@paradigmasoft.com" target="_blank">ivan_smahin@paradigmasoft.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div style="word-wrap:break-word"><div><div><br><div><div>On Nov 14, 2013, at 2:58 AM, Chris Jones <<a href="mailto:cjones@daz3d.com" target="_blank">cjones@daz3d.com</a>> wrote:</div>
<br><blockquote type="cite"><div dir="ltr">Hi,<div><br clear="all"><div>I am running into a slow down when I try to insert about a 100 records into a table. The table has only one column, a var char, and has a unique index on that column. The test table I am working with has about 320000 records currently in it. Also I am accessing the database as a client ( db is running as a service).</div>
<div><br></div><div>Is there a better way to do this than "AddRecord" on a table object? I need to ensure that the inserted items are unique and quickly searchable, hence the unique index. Thank you for any help.</div>
</div></div></blockquote></div><div><br></div></div></div>One more possibility is to use row-constructor syntax:<div><br></div><div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(209,47,27)">insert into t1 VALUES (1, '1'), (2, '2') </div>
<div><br></div><div>It means - add 2 rows at once:</div><div><br></div><div>1, '1'</div><div>2, '2'</div><div><div><br></div><div>
<span style="border-collapse:separate;border-spacing:0px"><div>-- <br>Best regards,<br>Ivan Smahin<br>Senior Software Engineer<br>Paradigma Software, Inc<br>Valentina - The Ultra-Fast Database<br><a href="http://www.valentina-db.com/" target="_blank">http://www.valentina-db.com</a></div>
</span>
</div>
<br></div></div></div><br></div></div><div class="im">_______________________________________________<br>
Valentina mailing list<br>
<a href="mailto:Valentina@lists.macserve.net" target="_blank">Valentina@lists.macserve.net</a><br>
<a href="http://lists.macserve.net/mailman/listinfo/valentina" target="_blank">http://lists.macserve.net/mailman/listinfo/valentina</a><br>
<br></div></blockquote></div><br><br clear="all"><div class="im"><br>-- <br>Christopher Jones<br>Software Developer<br>DAZ 3D<br>
</div></div>
</blockquote></div><br><br clear="all"><br>-- <br>Christopher Jones<br>Software Developer<br>DAZ 3D<br>
</div>