let index_constant ~dbd =
let query = prepare_insert () in
fun ~uri ~body ~ty ->
- if not (already_indexed uri) then begin
+ if not (already_indexed uri) then beginrel_tbl ()
let name = UriManager.name_of_uri uri in
let uri = UriManager.string_of_uri uri in
let metadata = MetadataExtractor.compute ~body ~ty in
List.iter (fun (uri, name, _) -> insert_name ~dbd ~uri ~name) metadata
end
*)
+
+(***** TENTATIVE HACK FOR THE DB SLOWDOWN - BEGIN *******)
+let analyze_index = ref 0
+let eventually_analyze dbd =
+ incr analyze_index;
+ if !analyze_index > 30 then
+ begin
+ let analyze t = "ANALYZE TABLE " ^ t ^ ";" in
+ List.iter
+ (fun table -> ignore (Mysql.exec dbd (analyze table)))
+ [name_tbl (); rel_tbl (); sort_tbl (); obj_tbl(); count_tbl()]
+ end
+
+(***** TENTATIVE HACK FOR THE DB SLOWDOWN - END *******)
+
let index_obj ~dbd ~uri =
if not (already_indexed uri) then begin
+ eventually_analyze dbd;
let metadata = MetadataExtractor.compute_obj uri in
let uri_of (a,b,c) = (a,c) in
let uri = UriManager.string_of_uri uri in