MYDDAS: New internal organization and new MYDDAS statistics
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1646 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
f77458e11f
commit
4bf4767073
4
C/exec.c
4
C/exec.c
@ -23,8 +23,8 @@ static char SccsId[] = "@(#)cdmgr.c 1.1 05/02/98";
|
||||
#ifdef CUT_C
|
||||
#include "cut_c.h"
|
||||
#endif
|
||||
#if defined CUT_C && (defined MYDDAS_ODBC || defined MYDDAS_MYSQL)
|
||||
#include "myddas_util.h"
|
||||
#if defined MYDDAS_ODBC || defined MYDDAS_MYSQL
|
||||
#include "myddas.h"
|
||||
#endif
|
||||
|
||||
STATIC_PROTO(Int CallPredicate, (PredEntry *, choiceptr, yamop *));
|
||||
|
@ -142,6 +142,9 @@
|
||||
'$get_table_name'/2,
|
||||
'$get_values_for_update'/4,
|
||||
'$extract_args'/4,
|
||||
#ifdef MYDDAS_STATS
|
||||
'$make_stats_list'/2,
|
||||
#endif
|
||||
'$lenght'/2
|
||||
]).
|
||||
|
||||
@ -263,14 +266,16 @@ db_stats(List):-
|
||||
db_stats(Connection,List):-
|
||||
'$error_checks'(db_stats(Connection,List)),
|
||||
NumberOfStats = 10,
|
||||
'$make_a_list'(NumberOfStats,List),
|
||||
'$make_a_list'(NumberOfStats,ListX1),
|
||||
( var(Connection) ->
|
||||
c_db_stats(0,List)
|
||||
c_db_stats(0,ListX1)
|
||||
;
|
||||
get_value(Connection,Conn),
|
||||
c_db_stats(Conn,List)
|
||||
).
|
||||
c_db_stats(Conn,ListX1)
|
||||
),
|
||||
'$make_stats_list'(ListX1,List).
|
||||
|
||||
#ifdef DEBUG
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% db_stats_time(+,-)
|
||||
% Reference is C pointer (memory reference)
|
||||
@ -280,8 +285,9 @@ db_stats_time(Reference,Time):-
|
||||
c_db_stats_time(Reference,Time).
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
#endif /* DEBUG */
|
||||
|
||||
#endif
|
||||
#endif /* MYDDAS_STATS */
|
||||
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
@ -146,6 +146,9 @@
|
||||
% must have only one relation
|
||||
'$error_checks'(db_datalog_describe(Relation,_)) :- !,
|
||||
nonvar(Relation).
|
||||
'$error_checks'(db_describe(Connection,Relation,_)) :- !,
|
||||
atom(Connection),
|
||||
nonvar(Relation).
|
||||
'$error_checks'(db_my_show_tables(_)):- !.
|
||||
'$error_checks'(db_is_database_predicate(PredName,Arity,Module)):-!,
|
||||
nonvar(PredName),
|
||||
|
@ -100,7 +100,7 @@ db_datalog_describe(Connection,Relation) :-
|
||||
db_describe(Relation,TableInfo) :-
|
||||
db_describe(myddas,Relation,TableInfo).
|
||||
db_describe(Connection,Relation,tableinfo(A1,A2,A3,A4,A5,A6)) :-
|
||||
'$error_checks'(db_my_describe(Relation,Connection)),
|
||||
'$error_checks'(db_describe(Relation,Connection,_)),
|
||||
'$get_value'(Connection,Conn),
|
||||
'$make_atom'(['DESCRIBE ',Relation],SQL),
|
||||
db_my_result_set(Mode),
|
||||
|
@ -39,6 +39,9 @@
|
||||
'$build_query'/5,
|
||||
'$assert_facts'/2,
|
||||
'$lenght'/2,
|
||||
#ifdef MYDDAS_STATS
|
||||
'$make_stats_list'/2,
|
||||
#endif
|
||||
'$check_list_on_list'/2
|
||||
]).
|
||||
|
||||
@ -431,3 +434,7 @@
|
||||
'$member_strick'(Element, Rest).
|
||||
|
||||
|
||||
'$make_stats_list'([],[]).
|
||||
'$make_stats_list'([Ref|Tail],[Time|Final]):-
|
||||
c_db_stats_time(Ref,Time),
|
||||
'$make_stats_list'(Tail,Final).
|
||||
|
Reference in New Issue
Block a user