From 60953812ac4a1a84b2e5dfbed9707fcf110e8b58 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Wed, 13 May 2026 22:33:34 +0000 Subject: [PATCH] Index AGGRESSIONS --- db/schemas/sokwedb/indexes/Makefile | 3 +- .../sokwedb/indexes/create/aggressions.m4 | 34 +++++++++++++++++++ .../sokwedb/indexes/drop/aggressions.m4 | 26 ++++++++++++++ 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 db/schemas/sokwedb/indexes/create/aggressions.m4 create mode 100644 db/schemas/sokwedb/indexes/drop/aggressions.m4 diff --git a/db/schemas/sokwedb/indexes/Makefile b/db/schemas/sokwedb/indexes/Makefile index d06a95f..7ef5dd1 100644 --- a/db/schemas/sokwedb/indexes/Makefile +++ b/db/schemas/sokwedb/indexes/Makefile @@ -21,7 +21,8 @@ # This is not really important but is needed for other types of db objects. ORDER := biography_data biography_log comm_membs comm_memb_log \ follows follow_observers follow_studies events roles arrivals \ - estrus_sources estrus_states aggression_event_log sightings + estrus_sources estrus_states aggression_event_log sightings \ + aggressions ## ## CAUTION: This Makefile is not designed to be run directly. It is normally diff --git a/db/schemas/sokwedb/indexes/create/aggressions.m4 b/db/schemas/sokwedb/indexes/create/aggressions.m4 new file mode 100644 index 0000000..1e02bae --- /dev/null +++ b/db/schemas/sokwedb/indexes/create/aggressions.m4 @@ -0,0 +1,34 @@ +dnl Copyright (C) 2026 The Meme Factory, Inc., http://www.karlpinc.com/ +dnl +dnl This program is free software: you can redistribute it and/or modify +dnl it under the terms of the GNU Affero General Public License as published +dnl by the Free Software Foundation, either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU Affero General Public License for more details. +dnl +dnl You should have received a copy of the GNU Affero General Public License +dnl along with this program. If not, see . +dnl +dnl Karl O. Pinc +dnl +dnl +dnl m4 includes +include(`copyright.m4')dnl +include(`constants.m4')dnl +include(`indexmacros.m4')dnl + +CREATE UNIQUE INDEX IF NOT EXISTS aggressions_eid ON aggressions + (eid); + +CREATE INDEX IF NOT EXISTS aggressions_community ON aggressions + (community); +-- There seems little point in indexing: +-- Severity +-- ExtractedBy +-- All the boolean columns +-- The descriptive textual columns + diff --git a/db/schemas/sokwedb/indexes/drop/aggressions.m4 b/db/schemas/sokwedb/indexes/drop/aggressions.m4 new file mode 100644 index 0000000..493b7d2 --- /dev/null +++ b/db/schemas/sokwedb/indexes/drop/aggressions.m4 @@ -0,0 +1,26 @@ +dnl Copyright (C) 2026 The Meme Factory, Inc., http://www.karlpinc.com/ +dnl +dnl This program is free software: you can redistribute it and/or modify +dnl it under the terms of the GNU Affero General Public License as published +dnl by the Free Software Foundation, either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU Affero General Public License for more details. +dnl +dnl You should have received a copy of the GNU Affero General Public License +dnl along with this program. If not, see . +dnl +dnl Karl O. Pinc +dnl +dnl +dnl m4 includes +include(`copyright.m4')dnl +include(`constants.m4')dnl +include(`indexmacros.m4')dnl + +DROP INDEX IF EXISTS aggressions_eid; + +DROP INDEX IF EXISTS aggressions_community; -- 2.34.1