Subject | Need fastest record count for condition |
---|---|
Author | ifitsx |
Post date | 2008-02-14T23:53:54Z |
w/IBO 4.2Hd, D7, and Fb 1.54
I'm working with a VirtualTreeview and two Tables:
One Table contains data on the folder nodes for the
VirtualTreeview, including whether the folder has
any documents that it owns.
The other Table contains rows for documents - notes -
including a blob.
The VirtualTreeview must know the exact count of
child nodes it will have, when the parent node is created.
This is currently maintained by a select statement on
the notes table with the simple criteria for the folder parent node,
and then using the IBOQuery.RecordCount value passed to the
VirtualTreeview InitChildren event.
I suspect that having to obtain these RecordCount results
for each level 0 node is a very, very costly process:
my folder table currently had 172 folder rows.
I'm wondering if there is a more efficient approach.
One that has occurred to me is to maintain a count
of the child node requirements, i.e., maintain a count of
the number of document records to be called for each folder
in a field of the folder, increasing and decreasing that
value as required.
I'd appreciate any opinions on this type of requirement.
I'm working with a VirtualTreeview and two Tables:
One Table contains data on the folder nodes for the
VirtualTreeview, including whether the folder has
any documents that it owns.
The other Table contains rows for documents - notes -
including a blob.
The VirtualTreeview must know the exact count of
child nodes it will have, when the parent node is created.
This is currently maintained by a select statement on
the notes table with the simple criteria for the folder parent node,
and then using the IBOQuery.RecordCount value passed to the
VirtualTreeview InitChildren event.
I suspect that having to obtain these RecordCount results
for each level 0 node is a very, very costly process:
my folder table currently had 172 folder rows.
I'm wondering if there is a more efficient approach.
One that has occurred to me is to maintain a count
of the child node requirements, i.e., maintain a count of
the number of document records to be called for each folder
in a field of the folder, increasing and decreasing that
value as required.
I'd appreciate any opinions on this type of requirement.