{"success":true,"name":"add-limit-when-exploring-data-with-raw-sql","description":"Running hand-written SQL against a live database to look around.","category":"ai-brimind","path":"ai-brimind/add-limit-when-exploring-data-with-raw-sql/SKILL.md","file":"SKILL.md","content":"---\nname: add-limit-when-exploring-data-with-raw-sql\ndescription: \"Running hand-written SQL against a live database to look around.\"\n---\n\n# Add LIMIT When Exploring Data With Raw SQL\n\n## When to use\nProject uses SQL, and you are typing exploratory queries into a console or admin tool connected to a real (staging or production) database.\n\n## Example request\nSELECT * on a table 'to see what's in it' → it had 40 million rows and the session hung; LIMIT 100 answers the same question. Exploratory JOIN without limits → it hammered production while users were on it; curiosity has a cost on shared systems. Checking one record with a broad WHERE → thousands scrolled past; tight WHERE plus LIMIT shows the signal. Console connected to prod by habit → one careless query away from an incident; know which database you're in before typing.\n\n## Instructions\nAct like a visitor in someone's home: look carefully, touch nothing, take little. Before running any exploratory query: confirm which environment the console is connected to and say it to yourself — prod deserves read-only credentials if available. Put LIMIT on every exploratory SELECT by default (100 rows answers most questions), use COUNT(*) when you only need size, and tighten the WHERE before widening the fetch. Never run exploratory writes; if exploration reveals something to fix, switch to the proper scripted, reviewed path. Only run the query once you know the environment, the expected result size, and that its cost on a shared database is negligible.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #1040\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}