Board index » delphi » Indices and client data sets

Indices and client data sets


2005-05-21 01:38:33 AM
delphi226
I was surprised to find that when a client data set is connected to a
table, it does not create index definitions which are the same as the
table. Is there any way to get it to to this or must I specify it
manually with TClientDataSet's AddIndex method ?
 
 

Re:Indices and client data sets

You must create the indexes manually. You don't normally need indexes
for the small number of records that CDS is intended to hold.
--
Bill Todd (TeamB)
Edward Diener writes:
Quote
I was surprised to find that when a client data set is connected to a
table, it does not create index definitions which are the same as the
table. Is there any way to get it to to this or must I specify it
manually with TClientDataSet's AddIndex method ?
 

Re:Indices and client data sets

Bill Todd writes:
Quote
You must create the indexes manually.
OK. Too bad their are not created automatically.
Quote
You don't normally need indexes
for the small number of records that CDS is intended to hold.
Huh ? Why in the world is CDS restricted to a small number of records ?
Indices are helpful in finding a record among any number of records.
 

Re:Indices and client data sets

In a normal client/server design you never select more than 100 rows
for the user to work with. If you want to find a record use Locate. It
does not require an index is is instantaneous for a small number of
records in memory. The only thing I normally use CDS indices for is if
I need a descending sort.
--
Bill Todd (TeamB)
 

Re:Indices and client data sets

"Edward Diener" <XXXX@XXXXX.COM>writes
Quote

Huh ? Why in the world is CDS restricted to a small number of records ?
Indices are helpful in finding a record among any number of records.
Welcome to Client/Server development.
bdn.borland.com/article/0,1410,28160,00.html
www.logicfundamentals.com/pages/BrowsingLargeTables.aspx
www.logicfundamentals.com/pages/TablesVsQueries.aspx
www.hower.org/Kudzu/Articles/DBDesign/index.html
krf
 

Re:Indices and client data sets

Hi Edward,
First of all I suggest you read a book of Eric Harmon
named Delphi Kylix Database development.
You can read also some articles of Cary Jensen about ClientDatasets
I have two strategies .
1-For Small(dimension) tables I retrieve all the records and create the indexes.
2-For Big Tables(Facts) I retrieve just some records based on parameters typed by the users.(Like Bill Said).
I define the indexes (for the dimension tables)Manually and at design time.
I think It wonīt be difficult for you to define these indexes at run time,since you can retrieve the metadata indexes information(At least I think So) by the Connection Object.
I myself donīt like to define anything at run time that could be done at design time,my focus is always on performance instead of easy of development.
I agree with you that Delphi should be smarter at design time.
Marcello
 

Re:Indices and client data sets

"Marcello Dias" <XXXX@XXXXX.COM>writes
Quote

Hi Edward,

First of all I suggest you read a book of Eric Harmon
named Delphi Kylix Database development.
You can read also some articles of Cary Jensen about ClientDatasets

I have two strategies .
1-For Small(dimension) tables I retrieve all the records and create the
indexes.
Just curious, assuming the data is coming from a RDBMS, what creating local
indexes do?
Quote
2-For Big Tables(Facts) I retrieve just some records based on parameters
typed by the users.(Like Bill Said).

I define the indexes (for the dimension tables)Manually and at design
time.
I think It wonīt be difficult for you to define these indexes at run
time,since you can retrieve the metadata indexes information(At least I
think So) by the Connection Object.
Quote

Since indexes are utilized by the RDBMS, what would retrieving metadata
indexes do for the client?
Quote

I agree with you that Delphi should be smarter at design time.
What does Delphi not do that would make it "smarter"?
 

Re:Indices and client data sets

"Kevin Frevert" <XXXX@XXXXX.COM>writes:
Quote
"Marcello Dias" <XXXX@XXXXX.COM>writes
news:4294ddd6$XXXX@XXXXX.COM...
Just curious, assuming the data is coming from a RDBMS, what creating local
indexes do?

They let the user order the Dbgrid by the column he wants for example.
Quote
>2-For Big Tables(Facts) I retrieve just some records based on parameters
typed by the users.(Like Bill Said).
>

Since indexes are utilized by the RDBMS, what would retrieving metadata
indexes do for the client?
The guy asked that he wants to create indexes at the client side that match the ones he has at the server side,since Delphi donīt do it automatically.I think this is the only way.
Quote

.

What does Delphi not do that would make it "smarter"?
Show a list of the RDBMS Indexes at Design Time.
Marcello
Quote


 

Re:Indices and client data sets

"Marcello Dias" <XXXX@XXXXX.COM>writes
Quote
>Just curious, assuming the data is coming from a RDBMS, what creating
local
>indexes do?
>
They let the user order the Dbgrid by the column he wants for example.

Yes, good point (I've done that myself).
Quote
>Since indexes are utilized by the RDBMS, what would retrieving metadata
>indexes do for the client?
The guy asked that he wants to create indexes at the client side that
match the ones he has at the server side,since Delphi donīt do it
automatically.I think this is the only way.
At least for our design, the indexes we create are of no use to the client.
Indexes are designed for server performance, not for the developer to use in
his/her code.
Quote
>What does Delphi not do that would make it "smarter"?
Show a list of the RDBMS Indexes at Design Time.
Why would that make Delphi "smarter"? (Putting my DBA hat on) If one of our
developers is somehow using (and relying on) the RDBMS indexes in their
code, he/she will not touch my database (taking hat off). I am pleased that
Delphi is smart enough by not letting a developer do that at design time.
 

Re:Indices and client data sets

Quote
"Marcello Dias" <XXXX@XXXXX.COM>writes
client.
Indexes are designed for server performance, not for the developer to use in
his/her code.

>>What does Delphi not do that would make it "smarter"?
>Show a list of the RDBMS Indexes at Design Time.

Why would that make Delphi "smarter"? (Putting my DBA hat on) If one of our
developers is somehow using (and relying on) the RDBMS indexes in their
code, he/she will not touch my database (taking hat off). I am pleased that
Delphi is smart enough by not letting a developer do that at design time.
Hi Kevin,
I think Iīm not expressing my self very clear.
If Delphi for instance show me the indexes that were defined in the RDBMS,I would write my querys at the TQuery without having to open SQL SERVERīS Enterprise manager just to see them.
I think we should optimize our Queryīs,and take indexes in Consideration isnīt It?
Marcello