empire-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ivan nemeth <ivan.nem...@forumdigital.net>
Subject Re: DBReader performance suggestion
Date Mon, 29 Sep 2014 06:16:21 GMT
Hi Francis,

ok, here it is:

https://issues.apache.org/jira/browse/EMPIREDB-213

Regards,
Ivan


On Sun, Sep 28, 2014 at 8:57 PM, Francis De Brabandere <francisdb@gmail.com>
wrote:

> Hi Ivan,
>
> Would you mind creating at ticket for this issue?
> https://issues.apache.org/jira/browse/EMPIREDB
>
> Thanks,
> Francis
>
> On 24 September 2014 16:14, Ivan Nemeth <ivan.nemeth@gmail.com> wrote:
> > Hi,
> >
> > the DBReader can be much faster for resultsets with many columns if the
> > getFieldIndex(ColumnExpr c) method uses some kind of caching. The
> following
> > code is 10 times faster for a resultset with 20000 rows and 70 columns.
> >
> > public class MyDBReader extends DBReader {
> >
> > private static final long serialVersionUID = 1L;
> > private Map<ColumnExpr, Integer> fieldIndices = new HashMap<ColumnExpr,
> > Integer>();
> >
> > @Override
> > public int getFieldIndex(ColumnExpr column) {
> > Integer i = fieldIndices.get(column);
> > if (i == null){
> > i = super.getFieldIndex(column);
> > fieldIndices.put(column, i);
> > }
> > return i;
> > }
> >
> > }
> >
> > What do you think?
> >
> > Regards,
> > Ivan
>

Mime
View raw message