<div dir="ltr">Sorry I don't use Livecode. I just executed the sql command "Commit".</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Nov 18, 2013 at 9:06 AM, william humphrey <span dir="ltr"><<a href="mailto:bill@bluewatermaritime.com" target="_blank">bill@bluewatermaritime.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Chris<br>
<br>
Can you post here an example of your "Commit to database" SQL call for<br>
Livecode? I've been having trouble with that.<br>
<br>
Bill<br>
<div><div class="h5"><br>
On Mon, Nov 18, 2013 at 11:12 AM, Chris Jones <<a href="mailto:cjones@daz3d.com">cjones@daz3d.com</a>> wrote:<br>
> Here is the user function I was trying to make:<br>
><br>
> CREATE OR REPLACE FUNCTION kywdCFV1 ( keyWord VARCHAR )<br>
> RETURNS ULONG<br>
> BEGIN<br>
> DECLARE keyRecID ULONG DEFAULT 0;<br>
> SELECT RecID INTO keyRecID FROM tblKeyword WHERE fldKeyword=keyWord LIMIT 1;<br>
> IF keyRecID>0 THEN<br>
> RETURN keyRecID;<br>
> ELSE<br>
> INSERT INTO tblKeyword (fldKeyword) VALUES (keyWord);<br>
> RETURN Last_RecID_Of_Table( 'tblKeyword' );<br>
> END IF<br>
> RETURN 0;<br>
> END<br>
><br>
> This is on a "tblKeyword" that has one column "fldKeyword". fldKeyword is a<br>
> VarChar(2044), indexed, unique, with kSecondary collation. I was running<br>
> my test on it when it had 300 thousand or so records.<br>
><br>
> Executing the sql: "SELECT RecID FROM tblKeyword WHERE<br>
> fldKeyword='keywordValue' LIMIT 1;" takes at couple milliseconds or less.<br>
> Executing the user function : "SELECT kywdCFV1('keywordValue');" takes 200<br>
> to 300 milliseconds. If the 'keywordValue' value is there. It takes 300+<br>
> milliseconds if 'keywordValue' value is not there and needs to be inserted.<br>
> However after it cause an insert, it takes 2-3 seconds to execute "SELECT<br>
> kywdCFV1('keywordValue');" on the same value. Until I close the database or<br>
> run the sql: "Commit". Then it returns to the 200 to 300 ms range.<br>
><br>
><br>
><br>
><br>
> On Mon, Nov 18, 2013 at 7:40 AM, Chris Jones <<a href="mailto:cjones@daz3d.com">cjones@daz3d.com</a>> wrote:<br>
>><br>
>> Hi Ruslan,<br>
>><br>
>> Yes our users work on localhost. Sorry if I was unclear about that<br>
>> earlier.<br>
>><br>
>><br>
>> On Mon, Nov 18, 2013 at 2:36 AM, Ruslan Zasukhin<br>
>> <<a href="mailto:ruslan_zasukhin@valentina-db.com">ruslan_zasukhin@valentina-db.com</a>> wrote:<br>
>>><br>
>>> On 11/16/13, 7:09 PM, "Chris Jones" <<a href="mailto:cjones@daz3d.com">cjones@daz3d.com</a>> wrote:<br>
>>><br>
>>> > However, I got some weird results testing this plan in Valentina<br>
>>> > Studio.<br>
>>> > First, this is all done on local host, so latency is not as big an<br>
>>> > issue as it<br>
>>> > could be. However our users all use this database on localhost too, so<br>
>>> > this<br>
>>> > is the correct enviroment.<br>
>>><br>
>>> Hi Chris,<br>
>>><br>
>>> I want to clarify this -- so your users work<br>
>>><br>
>>> app - vserver on localhost ?<br>
>>><br>
>>> You told before it seems - remove vserver,<br>
>>> and 100 records take time one by one<br>
>>><br>
>>><br>
>>><br>
>>> --<br>
>>> Best regards,<br>
>>><br>
>>> Ruslan Zasukhin<br>
>>> VP Engineering and New Technology<br>
>>> Paradigma Software, Inc<br>
>>><br>
>>> Valentina - Joining Worlds of Information<br>
>>> <a href="http://www.paradigmasoft.com" target="_blank">http://www.paradigmasoft.com</a><br>
>>><br>
>>> [I feel the need: the need for speed]<br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> Valentina mailing list<br>
>>> <a href="mailto:Valentina@lists.macserve.net">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>
>><br>
>><br>
>><br>
>> --<br>
>> Christopher Jones<br>
>> Software Developer<br>
>> DAZ 3D<br>
><br>
><br>
><br>
><br>
> --<br>
> Christopher Jones<br>
> Software Developer<br>
> DAZ 3D<br>
><br>
> _______________________________________________<br>
> Valentina mailing list<br>
> <a href="mailto:Valentina@lists.macserve.net">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>
<br>
<br>
<br>
--<br>
</div></div><a href="http://www.bluewatermaritime.com" target="_blank">http://www.bluewatermaritime.com</a><br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
Valentina mailing list<br>
<a href="mailto:Valentina@lists.macserve.net">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>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Christopher Jones<br>Software Developer<br>DAZ 3D<br>
</div>