summaryrefslogtreecommitdiff
path: root/lib/input
diff options
context:
space:
mode:
Diffstat (limited to 'lib/input')
-rw-r--r--lib/input/sql/selectIndexes.sql7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/input/sql/selectIndexes.sql b/lib/input/sql/selectIndexes.sql
new file mode 100644
index 0000000..f1f3375
--- /dev/null
+++ b/lib/input/sql/selectIndexes.sql
@@ -0,0 +1,7 @@
+SELECT table_name, index_name,
+ GROUP_CONCAT(column_name ORDER BY seq_in_index) columns,
+ MIN(non_unique) non_unique
+FROM information_schema.statistics s
+WHERE table_schema = DATABASE()
+AND table_name = ?
+GROUP BY table_name, index_name