How does Dataset.Relations work internally?

  • Thread starter Thread starter Frank Rizzo
  • Start date Start date
F

Frank Rizzo

Does ADO.NET internally sets up hashtables for the columns that are used
to tie tables, so that later on hashtables can be used to quickly
retrieve data? Or does it just loop through data to locate the
ChildRows. For instance, in a line like this.

ds.Relations.Add(
new DataRelation(RELATION_BREAK_PRODUCT,
tblBreak.Columns[FIELD_BREAK_ID],
ds.Tables["Product"].Columns[FIELD_BREAK_ID]));



Thanks.
 
Frank,

This is probably a question for the softies, but given the fact that it
takes a while to add a relation, and it is damn quick to fetch childrows, I
suspect that some kind of pre-calculation is going on.

Now it might not be a hashtable - but maybe a combination of a bunch of
techniques.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/
 
I just looked at the source via Reflector and it seems like like they
are looping through rows on DataRow.GetChildRows().

Softies?
Frank,

This is probably a question for the softies, but given the fact that it
takes a while to add a relation, and it is damn quick to fetch childrows, I
suspect that some kind of pre-calculation is going on.

Now it might not be a hashtable - but maybe a combination of a bunch of
techniques.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/



Does ADO.NET internally sets up hashtables for the columns that are used
to tie tables, so that later on hashtables can be used to quickly
retrieve data? Or does it just loop through data to locate the
ChildRows. For instance, in a line like this.

ds.Relations.Add(
new DataRelation(RELATION_BREAK_PRODUCT,
tblBreak.Columns[FIELD_BREAK_ID],
ds.Tables["Product"].Columns[FIELD_BREAK_ID]));



Thanks.
 
DataRelation support is done via internal indexes for efficient access.

Andrew Conrad
Microsoft Corporation
 
Sofites == Microsoft employees. :-)

That term is entirely my creation - sorry.

BTW - Andrew answered your question. There is usage of internal indexes. So
there ya go.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/


Frank Rizzo said:
I just looked at the source via Reflector and it seems like like they are
looping through rows on DataRow.GetChildRows().

Softies?
Frank,

This is probably a question for the softies, but given the fact that it
takes a while to add a relation, and it is damn quick to fetch childrows,
I
suspect that some kind of pre-calculation is going on.

Now it might not be a hashtable - but maybe a combination of a bunch of
techniques.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/



Does ADO.NET internally sets up hashtables for the columns that are used
to tie tables, so that later on hashtables can be used to quickly
retrieve data? Or does it just loop through data to locate the
ChildRows. For instance, in a line like this.

ds.Relations.Add(
new DataRelation(RELATION_BREAK_PRODUCT,
tblBreak.Columns[FIELD_BREAK_ID],
ds.Tables["Product"].Columns[FIELD_BREAK_ID]));



Thanks.
 
Btw, are you the guy, Carl Franklin mentions on his show all the time?
You bet there are tonnes of softies who watch these NG's regularly. If there
is an unanswered question, you will see a softie show up sooner or later and
clear it out. BTW - Andrew Conrad (the guy who just answered your question)
is a softie.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/


Sahil said:
Sofites == Microsoft employees. :-)

I know what it means. I was just calling out to see whether there was any
softies in the crowd here.

That term is entirely my creation - sorry.

BTW - Andrew answered your question. There is usage of internal indexes.
So there ya go.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/




I just looked at the source via Reflector and it seems like like they are
looping through rows on DataRow.GetChildRows().

Softies?

Sahil Malik [MVP] wrote:


Frank,

This is probably a question for the softies, but given the fact that it
takes a while to add a relation, and it is damn quick to fetch
childrows, I
suspect that some kind of pre-calculation is going on.

Now it might not be a hashtable - but maybe a combination of a bunch of
techniques.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/






Does ADO.NET internally sets up hashtables for the columns that are
used
to tie tables, so that later on hashtables can be used to quickly
retrieve data? Or does it just loop through data to locate the
ChildRows. For instance, in a line like this.

ds.Relations.Add(
new DataRelation(RELATION_BREAK_PRODUCT,
tblBreak.Columns[FIELD_BREAK_ID],
ds.Tables["Product"].Columns[FIELD_BREAK_ID]));



Thanks.
 
I think so .. I know Carl .. so I must be him .. when and how did he mention
me? I hope he isn't making fun of me :-). What specific show ru talking
about man?

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/



Frank Rizzo said:
Btw, are you the guy, Carl Franklin mentions on his show all the time?
You bet there are tonnes of softies who watch these NG's regularly. If there
is an unanswered question, you will see a softie show up sooner or later and
clear it out. BTW - Andrew Conrad (the guy who just answered your question)
is a softie.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/


Sahil Malik [MVP] wrote:

Sofites == Microsoft employees. :-)

I know what it means. I was just calling out to see whether there was any
softies in the crowd here.


That term is entirely my creation - sorry.

BTW - Andrew answered your question. There is usage of internal indexes.
So there ya go.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/




I just looked at the source via Reflector and it seems like like they are
looping through rows on DataRow.GetChildRows().

Softies?

Sahil Malik [MVP] wrote:


Frank,

This is probably a question for the softies, but given the fact that it
takes a while to add a relation, and it is damn quick to fetch
childrows, I
suspect that some kind of pre-calculation is going on.

Now it might not be a hashtable - but maybe a combination of a bunch of
techniques.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/






Does ADO.NET internally sets up hashtables for the columns that are
used
to tie tables, so that later on hashtables can be used to quickly
retrieve data? Or does it just loop through data to locate the
ChildRows. For instance, in a line like this.

ds.Relations.Add(
new DataRelation(RELATION_BREAK_PRODUCT,
tblBreak.Columns[FIELD_BREAK_ID],
ds.Tables["Product"].Columns[FIELD_BREAK_ID]));



Thanks.
 
Sahil said:
I think so .. I know Carl .. so I must be him .. when and how did he mention
me? I hope he isn't making fun of me :-). What specific show ru talking
about man?
DotNetRocks


- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/



Btw, are you the guy, Carl Franklin mentions on his show all the time?
You bet there are tonnes of softies who watch these NG's regularly. If
there
is an unanswered question, you will see a softie show up sooner or later
and
clear it out. BTW - Andrew Conrad (the guy who just answered your
question)
is a softie.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/




Sahil Malik [MVP] wrote:


Sofites == Microsoft employees. :-)

I know what it means. I was just calling out to see whether there was
any
softies in the crowd here.



That term is entirely my creation - sorry.

BTW - Andrew answered your question. There is usage of internal
indexes.
So there ya go.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/





I just looked at the source via Reflector and it seems like like they
are
looping through rows on DataRow.GetChildRows().

Softies?

Sahil Malik [MVP] wrote:



Frank,

This is probably a question for the softies, but given the fact that
it
takes a while to add a relation, and it is damn quick to fetch
childrows, I
suspect that some kind of pre-calculation is going on.

Now it might not be a hashtable - but maybe a combination of a bunch
of
techniques.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/







Does ADO.NET internally sets up hashtables for the columns that are
used
to tie tables, so that later on hashtables can be used to quickly
retrieve data? Or does it just loop through data to locate the
ChildRows. For instance, in a line like this.

ds.Relations.Add(
new DataRelation(RELATION_BREAK_PRODUCT,
tblBreak.Columns[FIELD_BREAK_ID],
ds.Tables["Product"].Columns[FIELD_BREAK_ID]));



Thanks.
 
I meant which DotNetRocks show :-)

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/


Frank Rizzo said:
Sahil said:
I think so .. I know Carl .. so I must be him .. when and how did he
mention
me? I hope he isn't making fun of me :-). What specific show ru talking
about man?
DotNetRocks


- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/



Btw, are you the guy, Carl Franklin mentions on his show all the time?

Sahil Malik [MVP] wrote:

You bet there are tonnes of softies who watch these NG's regularly. If
there

is an unanswered question, you will see a softie show up sooner or later
and

clear it out. BTW - Andrew Conrad (the guy who just answered your
question)

is a softie.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/




Sahil Malik [MVP] wrote:


Sofites == Microsoft employees. :-)

I know what it means. I was just calling out to see whether there was
any

softies in the crowd here.



That term is entirely my creation - sorry.

BTW - Andrew answered your question. There is usage of internal
indexes.

So there ya go.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/





I just looked at the source via Reflector and it seems like like they
are

looping through rows on DataRow.GetChildRows().

Softies?

Sahil Malik [MVP] wrote:



Frank,

This is probably a question for the softies, but given the fact that
it

takes a while to add a relation, and it is damn quick to fetch
childrows, I
suspect that some kind of pre-calculation is going on.

Now it might not be a hashtable - but maybe a combination of a bunch
of

techniques.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/







Does ADO.NET internally sets up hashtables for the columns that are
used
to tie tables, so that later on hashtables can be used to quickly
retrieve data? Or does it just loop through data to locate the
ChildRows. For instance, in a line like this.

ds.Relations.Add(
new DataRelation(RELATION_BREAK_PRODUCT,
tblBreak.Columns[FIELD_BREAK_ID],
ds.Tables["Product"].Columns[FIELD_BREAK_ID]));



Thanks.
 
Back
Top