Article View: borland.public.cppbuilder.database.ado
Article #187Re: Creating composite primary-keys or indexes at run-time...
From: Vassiliev V. V.
Date: Thu, 31 May 2007 19:12
Date: Thu, 31 May 2007 19:12
50 lines
2703 bytes
2703 bytes
Connect and execute SQL command: CREATE INDEX IX_MyIndex ON MyTable (Word, Lang) or, better, add new column ID counter and define PK on it. Counter is integer and index on it will require less space than index on string column. //------------------------------------------ Regards, Vassiliev V. V. http://www.managed-vcl.com - using .Net objects in Delphi for Win32 + ADO.Net http://www.oledbdirect.com - The fastest way to access MS SQL Server, MS Jet (Access) and Interbase (through OLEDB) "Vladimir Stefanovic" <antivari@po.sbb.co.yu> �������/�������� � �������� ���������: news:465f19ac@newsgroups.borland.com... >I have MS Access database/table with attributes: > > 1. Word (text) > 2. Lang (bool) > 3. Translation (text) > > It has 270,000 records. > > * Database without any indexes and PKs is about 17MB (6MB compressed) > * Database *with* just indexes on Word and Lang is about 23MB (8MB > compressed) > * Database *with* PK on Word and Lang is about 23MB (8MB compressed) > (I suppose that in this case indexes are made by default) > > SQL response is dramatically slower without indexes. > > I have to deploy this DB with the installation procedure, and I want to > save this 2MB ( 8MB - 6MB ). > > The idea is to deploy the database without idexes and than make composite > PK (Word+Lang), or just indexes on Word and Lang at run-time, during > installation procedure. > > The question is how to make (composite in this case) PKs or indexes > at run-time? I'm using ADO. > > > > -- > Best Regards, > Vladimir Stefanovic >
Technical Details
Message-ID:
<465f1e4c@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<465f19ac@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,73386e07f30a2d6f X-Google-Attributes: gid10698b,public,usenet X-Google-Language: ENGLISH,ASCII From: "Vassiliev V. V." <support@oledbdirect.com> Newsgroups: borland.public.cppbuilder.database.ado References: <465f19ac@newsgroups.borland.com> Subject: Re: Creating composite primary-keys or indexes at run-time... Date: Thu, 31 May 2007 23:12:23 +0400 Lines: 52 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3028 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-RFC2646: Format=Flowed; Response X-Antivirus: avast! (VPS 000746-0, 30.05.2007), Outbound message X-Antivirus-Status: Clean NNTP-Posting-Host: 85.93.138.132 Message-ID: <465f1e4c@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1180638796 85.93.138.132 (31 May 2007 12:13:16 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail