- Timestamp:
- 08/12/18 15:48:05 (6 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/fits2sql.cc
r19154 r19155 68 68 ("conditional", po_switch(), "Conditional insert. Only insert if no entry exists yet with the constants defined by --const") 69 69 ("delete", po_switch(), "Delete all entries first which fit all constant columns defined by --const") 70 ("index", po_switch(), "If a table is created, all const columns are used as a single index") 70 71 ; 71 72 … … 197 198 "If any row with the given constant values are found, the execution is stopped " 198 199 "(note that this happend after the table drop/create but before the delete/insert.\n" 200 "\n" 201 "To ensure efficient access for a conditonal execution, it makes sense to have " 202 "an index created for those columns. This can be done during table creation " 203 "with the --index option.\n" 199 204 "\n" 200 205 "If a query failed, the query is printed to stderr together with the error message. " … … 324 329 const bool conditional = conf.Get<bool>("conditional"); 325 330 const bool run_delete = conf.Get<bool>("delete"); 331 const bool index = conf.Get<bool>("index"); 326 332 327 333 const string engine = conf.Get<string>("engine"); … … 412 418 413 419 string where; 420 vector<string> vindex; 414 421 for (auto it=fixed.cbegin(); it!=fixed.cend(); it++) 415 422 { … … 450 457 vec.emplace_back(name, val); 451 458 where += " AND `"+name+"`="+val; 459 vindex.emplace_back(name); 452 460 } 453 461 … … 581 589 query += ",\n PRIMARY KEY USING BTREE (`"+boost::algorithm::join(primary, "`, `")+"`)"; 582 590 591 if (!vindex.empty() && index) 592 query += ",\n INDEX USING BTREE (`"+boost::algorithm::join(vindex, "`, `")+"`)"; 593 583 594 query += 584 595 "\n)\n" -
trunk/FACT++/src/root2sql.cc
r19154 r19155 71 71 ("conditional", po_switch(), "Conditional insert. Only insert if no entry exists yet with the constants defined by --const") 72 72 ("delete", po_switch(), "Delete all entries first which fit all constant columns defined by --const") 73 ("index", po_switch(), "If a table is created, all const columns are used as a single index") 73 74 ; 74 75 … … 205 206 "(note that this happend after the table drop/create but before the delete/insert.\n" 206 207 "\n" 208 "To ensure efficient access for a conditonal execution, it makes sense to have " 209 "an index created for those columns. This can be done during table creation " 210 "with the --index option.\n" 211 "\n" 207 212 "If a query failed, the query is printed to stderr together with the error message. " 208 213 "For the main INSERT query, this is only true if the verbosity level is at least 2 " … … 319 324 if (string(msg).substr(0,24)=="no dictionary for class ") 320 325 return; 326 if (string(msg).substr(0, 5)=="unknown branch ") 327 return; 321 328 322 329 DefaultErrorHandler(level, abort, location, msg); … … 353 360 const bool conditional = conf.Get<bool>("conditional"); 354 361 const bool run_delete = conf.Get<bool>("delete"); 362 const bool index = conf.Get<bool>("index"); 355 363 356 364 const string engine = conf.Get<string>("engine"); … … 435 443 436 444 string where; 445 vector<string> vindex; 437 446 for (auto it=fixed.cbegin(); it!=fixed.cend(); it++) 438 447 { … … 473 482 vec.emplace_back(name, val); 474 483 where += " AND `"+name+"`="+val; 484 vindex.emplace_back(name); 475 485 } 476 486 … … 615 625 if (!primary.empty()) 616 626 query += ",\n PRIMARY KEY USING BTREE (`"+boost::algorithm::join(primary, "`, `")+"`)"; 627 628 if (!vindex.empty() && index) 629 query += ",\n INDEX USING BTREE (`"+boost::algorithm::join(vindex, "`, `")+"`)"; 617 630 618 631 query +=
Note:
See TracChangeset
for help on using the changeset viewer.