Skip to content

Instantly share code, notes, and snippets.

View nilsmeyer's full-sized avatar

Nils Meyer nilsmeyer

  • Redundantia UG
  • Offenburg, BW, Germany
View GitHub Profile
@nilsmeyer
nilsmeyer / gist:2e1396fe5e504b2af20dd54054b3dca5
Created October 4, 2017 10:09
Get the maximum size for an index
$database would be the database/schema...
SELECT c.TABLE_NAME, CONSTRAINT_NAME, SUM(CHARACTER_OCTET_LENGTH) AS length FROM KEY_COLUMN_USAGE kcu INNER JOIN COLUMNS c ON c.TABLE_SCHEMA = kcu.TABLE_SCHEMA AND c.TABLE_NAME = kcu.TABLE_NAME AND c.COLUMN_NAME = kcu.COLUMN_NAME WHERE kcu.TABLE_SCHEMA='$database' GROUP BY CONSTRAINT_NAME, c.TABLE_NAME ORDER BY length;
- name: enrich partition data
set_fact:
_partitions: >
{{
_partitions|combine({_partuuids[item.0.device + '_' + item.1.num|string]:
_partitions[_partuuids[item.0.device + '_' + item.1.num|string]]|combine(item.1)})
}}
with_subelements:
- "{{ layout }}"
- partitions