MYDDAS: Enhanced statistics ability
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1628 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
955c6d7b32
commit
174a2c4518
@ -21,6 +21,7 @@ myddas_util_initialize_myddas(void){
|
|||||||
#ifdef MYDDAS_STATS
|
#ifdef MYDDAS_STATS
|
||||||
global->myddas_statistics = (MYDDAS_GLOBAL_STATS) malloc (sizeof(struct myddas_global_stats));
|
global->myddas_statistics = (MYDDAS_GLOBAL_STATS) malloc (sizeof(struct myddas_global_stats));
|
||||||
MYDDAS_STATS_INITIALIZE_TIME_STRUCT(global->myddas_statistics->total_db_row,time_final);
|
MYDDAS_STATS_INITIALIZE_TIME_STRUCT(global->myddas_statistics->total_db_row,time_final);
|
||||||
|
MYDDAS_STATS_INITIALIZE_TIME_STRUCT(global->myddas_statistics->total_translate,time_final);
|
||||||
#endif
|
#endif
|
||||||
return global;
|
return global;
|
||||||
}
|
}
|
||||||
@ -64,7 +65,6 @@ myddas_util_initialize_connection(void *conn,void *enviromment,
|
|||||||
|
|
||||||
new->lastBytesTransfered=0;
|
new->lastBytesTransfered=0;
|
||||||
new->totalBytesTransfered=0;
|
new->totalBytesTransfered=0;
|
||||||
MYDDAS_STATS_INITIALIZE_TIME_STRUCT(new->total_db_row,time_final);
|
|
||||||
new->total_querys_made=0;
|
new->total_querys_made=0;
|
||||||
#endif
|
#endif
|
||||||
return new;
|
return new;
|
||||||
|
@ -129,12 +129,16 @@ c_db_my_connect(void) {
|
|||||||
|
|
||||||
conn = mysql_init(NULL);
|
conn = mysql_init(NULL);
|
||||||
if (conn == NULL) {
|
if (conn == NULL) {
|
||||||
printf("erro no init\n");
|
#ifdef DEBUG
|
||||||
|
printf("ERROR: ** c_db_my_connect ** error on init\n");
|
||||||
|
#endif
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mysql_real_connect(conn, host, user, passwd, database, port, socket, CLIENT_MULTI_STATEMENTS) == NULL) {
|
if (mysql_real_connect(conn, host, user, passwd, database, port, socket, CLIENT_MULTI_STATEMENTS) == NULL) {
|
||||||
printf("erro no connect\n");
|
#ifdef DEBUG
|
||||||
|
printf("ERROR: ** c_db_my_connect ** error on connect\n");
|
||||||
|
#endif
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,10 +147,11 @@ c_db_my_connect(void) {
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Criar um novo no na lista de ligacoes*/
|
/* Criar um novo no na lista de ligacoes*/
|
||||||
//new = add_connection(&TOP,conn,NULL);
|
|
||||||
new = myddas_util_add_connection(conn,NULL);
|
new = myddas_util_add_connection(conn,NULL);
|
||||||
if (new == NULL){
|
if (new == NULL){
|
||||||
printf("Erro ao alocar memoria para lista\n");
|
#ifdef DEBUG
|
||||||
|
printf("ERROR: ** c_db_my_connect ** Error allocating memory\n");
|
||||||
|
#endif
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -549,7 +554,7 @@ c_db_my_row(void) {
|
|||||||
free(end);
|
free(end);
|
||||||
free(start);
|
free(start);
|
||||||
|
|
||||||
MYDDAS_STATS_GET_DB_ROW_FUNCTION(total_time);
|
MYDDAS_STATS_GET_TRANSLATE(total_time);
|
||||||
myddas_stats_add_time(total_time,diff,total_time);
|
myddas_stats_add_time(total_time,diff,total_time);
|
||||||
|
|
||||||
free(diff);
|
free(diff);
|
||||||
|
@ -302,8 +302,8 @@ c_db_odbc_query(void) {
|
|||||||
Term arg_bind_list = Deref(ARG4);
|
Term arg_bind_list = Deref(ARG4);
|
||||||
Term arg_conn = Deref(ARG5);
|
Term arg_conn = Deref(ARG5);
|
||||||
|
|
||||||
char *sql = AtomName(AtomOfTerm(arg_sql_query));
|
SQLCHAR *sql = AtomName(AtomOfTerm(arg_sql_query));
|
||||||
|
|
||||||
|
|
||||||
SQLHDBC hdbc =(SQLHDBC) (IntegerOfTerm(arg_conn));
|
SQLHDBC hdbc =(SQLHDBC) (IntegerOfTerm(arg_conn));
|
||||||
SQLHSTMT hstmt;
|
SQLHSTMT hstmt;
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* *
|
* *
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
#if defined CUT_C && (defined MYDDAS_MYSQL || defined MYDDAS_ODBC)
|
#if defined MYDDAS_MYSQL || defined MYDDAS_ODBC
|
||||||
|
|
||||||
#include "Yap.h"
|
#include "Yap.h"
|
||||||
#include "Yatom.h"
|
#include "Yatom.h"
|
||||||
@ -39,6 +39,9 @@ STATIC_PROTO(Int c_db_delete_predicate,(void));
|
|||||||
STATIC_PROTO(Int c_db_multi_queries_number,(void));
|
STATIC_PROTO(Int c_db_multi_queries_number,(void));
|
||||||
#ifdef MYDDAS_STATS
|
#ifdef MYDDAS_STATS
|
||||||
STATIC_PROTO(Int c_db_stats,(void));
|
STATIC_PROTO(Int c_db_stats,(void));
|
||||||
|
STATIC_PROTO(Int c_db_stats_walltime,(void));
|
||||||
|
STATIC_PROTO(Int c_db_stats_translate,(void));
|
||||||
|
STATIC_PROTO(Int c_db_stats_time,(void));
|
||||||
#endif
|
#endif
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
STATIC_PROTO(Int c_db_check,(void));
|
STATIC_PROTO(Int c_db_check,(void));
|
||||||
@ -62,8 +65,17 @@ void Yap_InitMYDDAS_SharedPreds(void)
|
|||||||
Yap_InitCPred("c_db_multi_queries_number",2,c_db_multi_queries_number, 0);
|
Yap_InitCPred("c_db_multi_queries_number",2,c_db_multi_queries_number, 0);
|
||||||
|
|
||||||
#ifdef MYDDAS_STATS
|
#ifdef MYDDAS_STATS
|
||||||
/* db_stats: Connection * Stats*/
|
/* c_db_stats: Connection * Stats */
|
||||||
Yap_InitCPred("c_db_stats",2, c_db_stats, 0);
|
Yap_InitCPred("c_db_stats",2, c_db_stats, 0);
|
||||||
|
|
||||||
|
/* c_db_stats_walltime */
|
||||||
|
Yap_InitCPred("c_db_stats_walltime",1, c_db_stats_walltime, 0);
|
||||||
|
|
||||||
|
/* c_db_stats_translate */
|
||||||
|
Yap_InitCPred("c_db_stats_translate",2,c_db_stats_translate, 0);
|
||||||
|
|
||||||
|
/* c_db_stats_time */
|
||||||
|
Yap_InitCPred("c_db_stats_time",2,c_db_stats_time, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@ -298,6 +310,93 @@ c_db_check(void){
|
|||||||
#endif /*DEBUG*/
|
#endif /*DEBUG*/
|
||||||
|
|
||||||
#ifdef MYDDAS_STATS
|
#ifdef MYDDAS_STATS
|
||||||
|
|
||||||
|
static Int
|
||||||
|
c_db_stats_walltime(void){
|
||||||
|
Term arg_time = Deref(ARG1);
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
if (IsVarTerm(arg_time)){
|
||||||
|
#endif
|
||||||
|
Yap_unify(arg_time,MkIntegerTerm((Int)myddas_stats_walltime()));
|
||||||
|
return TRUE;
|
||||||
|
#ifdef DEBUG
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
printf ("ERROR: c_db_stats_walltime got a variable\n");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
c_db_stats_translate(void){
|
||||||
|
Term arg_start = Deref(ARG1);
|
||||||
|
Term arg_end = Deref(ARG2);
|
||||||
|
|
||||||
|
MYDDAS_STATS_TIME start;
|
||||||
|
MYDDAS_STATS_TIME end;
|
||||||
|
|
||||||
|
MYDDAS_STATS_TIME total_time,diff;
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
//Both args must be instanciated
|
||||||
|
if (IsNonVarTerm(arg_start) && IsNonVarTerm(arg_end)){
|
||||||
|
#endif
|
||||||
|
start = (MYDDAS_STATS_TIME) IntegerOfTerm(arg_start);
|
||||||
|
end = (MYDDAS_STATS_TIME) IntegerOfTerm(arg_end);
|
||||||
|
|
||||||
|
MYDDAS_STATS_GET_TRANSLATE(total_time);
|
||||||
|
|
||||||
|
MYDDAS_STATS_INITIALIZE_TIME_STRUCT(diff,time_copy);
|
||||||
|
myddas_stats_subtract_time(diff,end,start);
|
||||||
|
|
||||||
|
diff = myddas_stats_time_copy_to_final(diff);
|
||||||
|
myddas_stats_add_time(total_time,diff,total_time);
|
||||||
|
|
||||||
|
free(diff);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
#ifdef DEBUG
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
printf ("ERROR: c_db_stats_translate got a variable\n");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static Int
|
||||||
|
c_db_stats_time(void){
|
||||||
|
Term arg_reference = Deref(ARG1);
|
||||||
|
Term arg_time = Deref(ARG2);
|
||||||
|
|
||||||
|
MYDDAS_STATS_TIME time = (MYDDAS_STATS_TIME )IntegerOfTerm(arg_reference);
|
||||||
|
|
||||||
|
Functor functor = Yap_MkFunctor(Yap_LookupAtom("myddas_time"),5);
|
||||||
|
Term time_numbers[5];
|
||||||
|
|
||||||
|
int time_number;
|
||||||
|
|
||||||
|
time_number = MYDDAS_STATS_TIME_HOURS(time);
|
||||||
|
time_numbers[0] = MkIntegerTerm(time_number);
|
||||||
|
time_number = MYDDAS_STATS_TIME_MINUTES(time);
|
||||||
|
time_numbers[1] = MkIntegerTerm(time_number);
|
||||||
|
time_number = MYDDAS_STATS_TIME_SECONDS(time);
|
||||||
|
time_numbers[2] = MkIntegerTerm(time_number);
|
||||||
|
time_number = MYDDAS_STATS_TIME_MILISECONDS(time);
|
||||||
|
time_numbers[3] = MkIntegerTerm(time_number);
|
||||||
|
time_number = MYDDAS_STATS_TIME_MICROSECONDS(time);
|
||||||
|
time_numbers[4] = MkIntegerTerm(time_number);
|
||||||
|
|
||||||
|
|
||||||
|
if (!Yap_unify(arg_time, Yap_MkApplTerm(functor,5,time_numbers))){
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
//Returns the stats of this module in a list
|
//Returns the stats of this module in a list
|
||||||
static Int
|
static Int
|
||||||
c_db_stats(void) {
|
c_db_stats(void) {
|
||||||
@ -423,6 +522,19 @@ c_db_stats(void) {
|
|||||||
printf ("Number of Querys made to the server\n");
|
printf ("Number of Querys made to the server\n");
|
||||||
printf ("%lu\n\n",(unsigned long)number);
|
printf ("%lu\n\n",(unsigned long)number);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//[Index 10] -> Total of Time Spent by the
|
||||||
|
// translate predicate
|
||||||
|
head = HeadOfTerm(list);
|
||||||
|
list = TailOfTerm(list);
|
||||||
|
MYDDAS_STATS_GET_TRANSLATE(time);
|
||||||
|
Yap_unify(head, MkIntegerTerm((Int)time));
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf ("Reference to time Spent by the translate predicate\n");
|
||||||
|
MYDDAS_STATS_PRINT_TIME_STRUCT(time);
|
||||||
|
printf ("\n\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -4,10 +4,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
#ifdef CUT_C
|
|
||||||
#if defined MYDDAS_ODBC || defined MYDDAS_MYSQL
|
#if defined MYDDAS_ODBC || defined MYDDAS_MYSQL
|
||||||
|
|
||||||
|
|
||||||
#if defined MYDDAS_STATS || defined MYDDAS_TOP_LEVEL
|
#if defined MYDDAS_STATS || defined MYDDAS_TOP_LEVEL
|
||||||
static void
|
static void
|
||||||
myddas_stats_time_subtract (unsigned long *, unsigned long *, MYDDAS_STATS_TIME, MYDDAS_STATS_TIME);
|
myddas_stats_time_subtract (unsigned long *, unsigned long *, MYDDAS_STATS_TIME, MYDDAS_STATS_TIME);
|
||||||
@ -243,4 +241,4 @@ myddas_stats_integrity_of_time(MYDDAS_STATS_TIME myddas_time){
|
|||||||
#endif /* MYDDAS_STATS || MYDDAS_TOP_LEVEL */
|
#endif /* MYDDAS_STATS || MYDDAS_TOP_LEVEL */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
@ -4,6 +4,12 @@
|
|||||||
|
|
||||||
#if defined MYDDAS_STATS || defined MYDDAS_TOP_LEVEL
|
#if defined MYDDAS_STATS || defined MYDDAS_TOP_LEVEL
|
||||||
|
|
||||||
|
#define MYDDAS_STATS_TIME_HOURS(TIME) TIME->u.time_final.hours;
|
||||||
|
#define MYDDAS_STATS_TIME_MINUTES(TIME) TIME->u.time_final.minutes;
|
||||||
|
#define MYDDAS_STATS_TIME_SECONDS(TIME) TIME->u.time_final.seconds;
|
||||||
|
#define MYDDAS_STATS_TIME_MILISECONDS(TIME) TIME->u.time_final.miliseconds;
|
||||||
|
#define MYDDAS_STATS_TIME_MICROSECONDS(TIME) TIME->u.time_final.microseconds;
|
||||||
|
|
||||||
#define MYDDAS_STATS_PRINT_TIME_STRUCT(TIME) \
|
#define MYDDAS_STATS_PRINT_TIME_STRUCT(TIME) \
|
||||||
if (TIME->type == time_final) { \
|
if (TIME->type == time_final) { \
|
||||||
printf ("%d Hours, %d Minutes, %d Seconds, %d Miliseconds, %d Microseconds", \
|
printf ("%d Hours, %d Minutes, %d Seconds, %d Miliseconds, %d Microseconds", \
|
||||||
@ -46,6 +52,7 @@ void
|
|||||||
myddas_stats_move_time(MYDDAS_STATS_TIME,MYDDAS_STATS_TIME);
|
myddas_stats_move_time(MYDDAS_STATS_TIME,MYDDAS_STATS_TIME);
|
||||||
MYDDAS_STATS_TIME
|
MYDDAS_STATS_TIME
|
||||||
myddas_stats_time_copy_to_final(MYDDAS_STATS_TIME);
|
myddas_stats_time_copy_to_final(MYDDAS_STATS_TIME);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -87,6 +94,9 @@ myddas_stats_time_copy_to_final(MYDDAS_STATS_TIME);
|
|||||||
#define MYDDAS_STATS_GET_DB_ROW_FUNCTION(TIME) \
|
#define MYDDAS_STATS_GET_DB_ROW_FUNCTION(TIME) \
|
||||||
TIME = Yap_REGS.MYDDAS_GLOBAL_POINTER->myddas_statistics->total_db_row;
|
TIME = Yap_REGS.MYDDAS_GLOBAL_POINTER->myddas_statistics->total_db_row;
|
||||||
|
|
||||||
|
#define MYDDAS_STATS_GET_TRANSLATE(TIME) \
|
||||||
|
TIME = Yap_REGS.MYDDAS_GLOBAL_POINTER->myddas_statistics->total_translate;
|
||||||
|
|
||||||
#endif /* MYDDAS_STATS */
|
#endif /* MYDDAS_STATS */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -16,7 +16,11 @@ struct myddas_global {
|
|||||||
#ifdef MYDDAS_STATS
|
#ifdef MYDDAS_STATS
|
||||||
/* This strucuture holds some global statistics*/
|
/* This strucuture holds some global statistics*/
|
||||||
struct myddas_global_stats {
|
struct myddas_global_stats {
|
||||||
|
/* Total Time spent on the db_row function */
|
||||||
MYDDAS_STATS_TIME total_db_row;
|
MYDDAS_STATS_TIME total_db_row;
|
||||||
|
|
||||||
|
/* Total Time spent on the translate/3 predicate*/
|
||||||
|
MYDDAS_STATS_TIME total_translate;
|
||||||
};
|
};
|
||||||
#endif /* MYDDAS_STATS */
|
#endif /* MYDDAS_STATS */
|
||||||
|
|
||||||
@ -59,11 +63,9 @@ struct myddas_list_connection {
|
|||||||
/* Total bytes transfered from the server */
|
/* Total bytes transfered from the server */
|
||||||
unsigned long lastBytesTransfered;
|
unsigned long lastBytesTransfered;
|
||||||
|
|
||||||
/* Total Time spent on the db_row function */
|
|
||||||
MYDDAS_STATS_TIME total_db_row;
|
|
||||||
|
|
||||||
/* Number of querys made to the Server*/
|
/* Number of querys made to the Server*/
|
||||||
unsigned long total_querys_made;
|
unsigned long total_querys_made;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
MYDDAS_UTIL_PREDICATE predicates;
|
MYDDAS_UTIL_PREDICATE predicates;
|
||||||
|
|
||||||
|
@ -24,8 +24,11 @@
|
|||||||
db_verbose/1,
|
db_verbose/1,
|
||||||
db_module/1,
|
db_module/1,
|
||||||
db_is_database_predicate/3,
|
db_is_database_predicate/3,
|
||||||
|
#ifdef MYDDAS_STATS
|
||||||
|
db_stats/1,
|
||||||
db_stats/2,
|
db_stats/2,
|
||||||
|
db_stats_time/2,
|
||||||
|
#endif
|
||||||
db_sql/2,
|
db_sql/2,
|
||||||
db_sql/3,
|
db_sql/3,
|
||||||
db_sql_select/3,
|
db_sql_select/3,
|
||||||
@ -249,27 +252,36 @@ db_is_database_predicate(Module,PredName,Arity):-
|
|||||||
c_db_check_if_exists_pred(PredName,Arity,Module).
|
c_db_check_if_exists_pred(PredName,Arity,Module).
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
|
#ifdef MYDDAS_STATS
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
% db_stats(+,-)
|
% db_stats(+,-)
|
||||||
%
|
%
|
||||||
%
|
%
|
||||||
:- set_value(db_myddas_stats_count,0).
|
db_stats(List):-
|
||||||
|
db_stats(myddas,List).
|
||||||
|
|
||||||
db_stats(Connection,List):-
|
db_stats(Connection,List):-
|
||||||
'$error_checks'(db_stats(Connection,List)),
|
'$error_checks'(db_stats(Connection,List)),
|
||||||
NumberOfStats = 9,
|
NumberOfStats = 10,
|
||||||
'$make_a_list'(NumberOfStats,List),
|
'$make_a_list'(NumberOfStats,List),
|
||||||
( var(Connection) ->
|
( var(Connection) ->
|
||||||
c_db_stats(0,List)
|
c_db_stats(0,List)
|
||||||
;
|
;
|
||||||
get_value(Connection,Conn),
|
get_value(Connection,Conn),
|
||||||
c_db_stats(Conn,List)
|
c_db_stats(Conn,List)
|
||||||
),
|
).
|
||||||
write('MYDDAS: '),nl,write(List),nl,
|
|
||||||
get_value(db_myddas_stats_count,Value),
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
write('Stats Counts '),write(Value),nl.
|
% db_stats_time(+,-)
|
||||||
|
% Reference is C pointer (memory reference)
|
||||||
|
%
|
||||||
|
db_stats_time(Reference,Time):-
|
||||||
|
'$error_checks'(db_stats_time(Reference,Time)),
|
||||||
|
c_db_stats_time(Reference,Time).
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
@ -61,8 +61,13 @@
|
|||||||
'$error_checks'(db_command(Connection,SQL)):-!,
|
'$error_checks'(db_command(Connection,SQL)):-!,
|
||||||
atom(Connection),
|
atom(Connection),
|
||||||
nonvar(SQL).
|
nonvar(SQL).
|
||||||
|
#ifdef MYDDAS_STATS
|
||||||
'$error_checks'(db_stats(_,List)):-!,
|
'$error_checks'(db_stats(_,List)):-!,
|
||||||
var(List).
|
var(List).
|
||||||
|
'$error_checks'(db_stats_time(Reference,Time)):-!,
|
||||||
|
number(Reference),
|
||||||
|
var(Time).
|
||||||
|
#endif
|
||||||
'$error_checks'(db_export_view(Connection,TableViewName,SQLorDbGoal,FieldsInf)):-!,
|
'$error_checks'(db_export_view(Connection,TableViewName,SQLorDbGoal,FieldsInf)):-!,
|
||||||
atom(Connection),
|
atom(Connection),
|
||||||
( atom(TableViewName) -> atom(SQLorDbGoal) ; true ),
|
( atom(TableViewName) -> atom(SQLorDbGoal) ; true ),
|
||||||
|
@ -61,8 +61,18 @@
|
|||||||
%
|
%
|
||||||
% --------------------------------------------------------------------------------------
|
% --------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#ifdef MYDDAS_STATS
|
||||||
translate(ProjectionTerm,DatabaseGoal,SQLQueryTermOpt):-
|
translate(ProjectionTerm,DatabaseGoal,SQLQueryTermOpt):-
|
||||||
|
c_db_stats_walltime(Start),
|
||||||
|
translate_(ProjectionTerm,DatabaseGoal,SQLQueryTermOpt),
|
||||||
|
c_db_stats_walltime(End),
|
||||||
|
c_db_stats_translate(Start,End).
|
||||||
|
|
||||||
|
translate_(ProjectionTerm,DatabaseGoal,SQLQueryTermOpt):-
|
||||||
|
#else
|
||||||
|
translate(ProjectionTerm,DatabaseGoal,SQLQueryTermOpt):-
|
||||||
|
#endif
|
||||||
|
|
||||||
% --- initialize variable identifiers and range variables for relations -----
|
% --- initialize variable identifiers and range variables for relations -----
|
||||||
init_gensym(var),
|
init_gensym(var),
|
||||||
init_gensym(rel),
|
init_gensym(rel),
|
||||||
|
Reference in New Issue
Block a user