Home All Groups Group Topic Archive Search About

Expression - IFF - Performance problem

Author
10 Nov 2005 8:30 AM
RichS
Hi,

I'm trying to use the "Expression" property to convert a column of IDs into
Strings.  ( i.e. IIF(INFO_ID = 0, '" + strOption1 + "', IIF(INFO_ID = 1, '" +
strOption2 + "' ... )

However, I've noticed that the more IFFs I add the worse the performance of
my DataGrid gets.  I've edited my Expression and the contents of my DB so
that I always match on the first IFF in my expression, but this doesnt seem
to have any effect on improving performance.

The performance different is significant, with 2 IFFs in my expression I am
loading 5000 rows in about 1 sec.  With 11 IFFs in my expression it takes 35
seconds!!

Is there a solution to this ??  The only thing I can think of is to use a
JOIN in my SQL query and have a string lookup table in my DB, but I really
really dont want to do this as it will be a headache to manage.

RichS

Author
10 Nov 2005 10:47 AM
RichS
You guys are too slow ;-)

I solved my problem.  I re-wrote my code so that now I create in-memory
tables with the ID->Names and then use DataRelation to map the columns. 
Performance is back and code is only slightly more complicated.

RichS

Show quote
"RichS" wrote:

> Hi,
>
> I'm trying to use the "Expression" property to convert a column of IDs into
> Strings.  ( i.e. IIF(INFO_ID = 0, '" + strOption1 + "', IIF(INFO_ID = 1, '" +
> strOption2 + "' ... )
>
> However, I've noticed that the more IFFs I add the worse the performance of
> my DataGrid gets.  I've edited my Expression and the contents of my DB so
> that I always match on the first IFF in my expression, but this doesnt seem
> to have any effect on improving performance.
>
> The performance different is significant, with 2 IFFs in my expression I am
> loading 5000 rows in about 1 sec.  With 11 IFFs in my expression it takes 35
> seconds!!
>
> Is there a solution to this ??  The only thing I can think of is to use a
> JOIN in my SQL query and have a string lookup table in my DB, but I really
> really dont want to do this as it will be a headache to manage.
>
> RichS

AddThis Social Bookmark Button