Most Effective way to insert into an Indexed field
Beatrix Willius
bwillius at gmx.de
Mon Nov 18 00:21:39 CST 2013
Working with Xojo I have this issue, too.
- Checking if the unique value is already in the database. The SQL query was slow. Going in Xojo through an exception was even slower. Now I have a VBitSet, which made my app on repeated data import quite a bit faster.
- Adding record to a large table: I remember talking to Ruslan about this. This remains a problem.
For small to midsize databases it’s faster to do a complete re-index after adding the records. But I think I had problems with this. Also when the re-index doesn’t run in the background the customer isn’t happy. For large databases when only a few records are added this doesn’t work anyhow.
On 16.11.2013, at 09:30, Ivan Smahin <ivan_smahin at paradigmasoft.com> wrote:
>
> On Nov 14, 2013, at 2:58 AM, Chris Jones <cjones at daz3d.com> wrote:
>
>> Hi,
>>
>> 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).
>>
>> 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.
>
>
> One more possibility is to use row-constructor syntax:
>
> insert into t1 VALUES (1, '1'), (2, '2')
>
> It means - add 2 rows at once:
>
> 1, '1'
Mit freundlichen Grüßen/Regards
Trixi Willius
http://www.mothsoftware.com
Mail Archiver X: The email archiving solution for professionals
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macserve.net/pipermail/valentina/attachments/20131118/f892baba/attachment-0001.html>
More information about the Valentina
mailing list