Board index » delphi » Indices and client data sets
|
Edward Diener
Delphi Developer |
|
Edward Diener
Delphi Developer |
Indices and client data sets2005-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 ? |
| Bill Todd
Delphi Developer |
2005-05-21 02:59:47 AM
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: QuoteI was surprised to find that when a client data set is connected to a |
| Edward Diener
Delphi Developer |
2005-05-21 09:07:46 AM
Re:Indices and client data sets
Bill Todd writes:
QuoteYou must create the indexes manually. QuoteYou don't normally need indexes |
| Bill Todd
Delphi Developer |
2005-05-21 09:46:08 AM
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) |
| Kevin Frevert
Delphi Developer |
2005-05-25 11:19:39 AM
Re:Indices and client data sets
"Edward Diener" <XXXX@XXXXX.COM>writes
Quote
www.logicfundamentals.com/pages/BrowsingLargeTables.aspx www.logicfundamentals.com/pages/TablesVsQueries.aspx www.hower.org/Kudzu/Articles/DBDesign/index.html krf |
| Marcello Dias
Delphi Developer |
2005-05-26 04:19:34 AM
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 |
| Kevin Frevert
Delphi Developer |
2005-05-26 07:07:06 PM
Re:Indices and client data sets
"Marcello Dias" <XXXX@XXXXX.COM>writes
Quote
indexes do? Quote2-For Big Tables(Facts) I retrieve just some records based on parameters Quote
Quote
|
| Marcello Dias
Delphi Developer |
2005-05-27 06:00:27 AM
Re:Indices and client data sets
"Kevin Frevert" <XXXX@XXXXX.COM>writes:
Quote"Marcello Dias" <XXXX@XXXXX.COM>writes Quote>2-For Big Tables(Facts) I retrieve just some records based on parameters Quote
Quote |
| Kevin Frevert
Delphi Developer |
2005-05-27 09:39:53 PM
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 Quote>Since indexes are utilized by the RDBMS, what would retrieving metadata 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"? 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. |
| Marcello Dias
Delphi Developer |
2005-05-29 09:31:04 PM
Re:Indices and client data setsQuote"Marcello Dias" <XXXX@XXXXX.COM>writes 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 |
