Re: [gnome-db] libgda performance issues



"Vivien Malerba" <vmalerba gmail com> wrote:

> > I think I do not follow.
> > Do you mean I can invoke gda_connection_execute_select_command with
> > GdaParameterList ?
> 
> Yes, you can pass a GdaParameterList object to the
> gda_connection_execute_select_command() function, see the
> documentation about it for what named parameters it can contain.

I try to read docs and source code, and do not get params idea.
For MySQL provider params argument is just passed from one method to 
another. At the end ( when MySQL provider execute_command is invoked) 
these param argument is just ignored. 
gda_mysql_provider_execute_command just ignores ( doesn't use ) it at all.
 
I made another tests with GdaDataModel:

GdaDataModel *get_a_model (GdaConnection *cnc, const gchar *sql) 
{
        GdaDict *dict = gda_dict_new();
        gda_dict_set_connection(dict, cnc);

        GdaQuery *gdaquery =
                gda_query_new_from_sql(dict, sql, NULL);

        GdaDataModel *_model =  gda_data_model_query_new(gdaquery);

        g_object_unref(dict);
        g_object_unref(gdaquery);

        return _model;
}

GdaDataModel *get_b_model (GdaConnection *cnc, const gchar *sql) 
{
        GdaCommand *command;
        command = gda_command_new (sql,
                        GDA_COMMAND_TYPE_SQL,
                        GDA_COMMAND_OPTION_STOP_ON_ERRORS);

        GdaDataModel *model =
                gda_connection_execute_select_command(
                                cnc,
                                command, NULL, NULL);
        gda_command_free(command);
}

get_a_model seems to be twice faster than get_b_model.

*But* bottleneck seems to be interesting ( get_a_model ).  

Time: 0,0360238552094.

Add:
gda_data_model_get_n_rows(_model);
gda_data_model_get_n_columns(_model);

Time: 0,11718416214

Time is almost the same when I get only n_columns.

Results with get_b_model:

Time: 0.0784959793091
Time: 0.082288980484 /* with get_n_column */

Should I use different than GdaDataModel approach?

Piotras



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]