|
|
@@ -801,8 +801,13 @@ DATABASE SCHEMA (MySQL database 'food_db'):
|
|
|
TOOL TAGS (Generate these inside your response when you need details):
|
|
|
1. To run a read-only SELECT query, write:
|
|
|
<sql_query>SELECT ...</sql_query>
|
|
|
- Make sure to join tables on `code`. Optimize queries using LIKE. For example:
|
|
|
- <sql_query>SELECT c.product_name, m.proteins_100g FROM products_core c JOIN products_macros m ON c.code = m.code WHERE c.product_name LIKE '%apple%' LIMIT 5;</sql_query>
|
|
|
+ Make sure to join tables on `code`. Optimize queries using the FULLTEXT indexes on `products_core` for maximum speed.
|
|
|
+ Available FULLTEXT indexes:
|
|
|
+ * `idx_prod_name` on `product_name`
|
|
|
+ * `idx_ing_text` on `ingredients_text`
|
|
|
+ * `idx_prod_ing` on `product_name, ingredients_text`
|
|
|
+ Use MATCH() AGAINST('+word' IN BOOLEAN MODE) for searching. For example:
|
|
|
+ <sql_query>SELECT c.product_name, m.proteins_100g FROM products_core c JOIN products_macros m ON c.code = m.code WHERE MATCH(c.product_name) AGAINST('+apple' IN BOOLEAN MODE) LIMIT 5;</sql_query>
|
|
|
|
|
|
2. To run a web search for information not in the database, write:
|
|
|
<web_search>query</web_search>
|