View Issue Details

IDProjectCategoryView StatusLast Update
0000342My infrastructureGeneralpublic2025-11-29 14:01
Reporterdvl Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Summary0000342: duplicate indexes on ports table
DescriptionMany "FOREIGN KEY (last_commit_id) REFERENCES commit_log(id) " here:

freshports.org=> \d ports
                                               Table "public.ports"
        Column        |           Type           | Collation | Nullable |                 Default                  
----------------------+--------------------------+-----------+----------+------------------------------------------
 id                   | integer                  |           | not null | nextval('ports_id_seq'::regclass)
 element_id           | integer                  |           | not null | 
 category_id          | integer                  |           | not null | 
 short_description    | text                     |           |          | 
 long_description     | text                     |           |          | 
 version              | text                     |           |          | 
 revision             | text                     |           |          | 
 maintainer           | text                     |           |          | 
 homepage             | text                     |           |          | 
 master_sites         | text                     |           |          | 
 extract_suffix       | text                     |           |          | 
 package_exists       | boolean                  |           |          | 
 depends_build        | text                     |           |          | 
 depends_run          | text                     |           |          | 
 last_commit_id       | integer                  |           |          | 
 found_in_index       | boolean                  |           |          | 
 forbidden            | text                     |           |          | 
 broken               | text                     |           |          | 
 date_added           | timestamp with time zone |           |          | 'now'::text::timestamp(6) with time zone
 categories           | text                     |           |          | 
 deprecated           | text                     |           |          | 
 ignore               | text                     |           |          | 
 master_port          | text                     |           |          | 
 latest_link          | text                     |           |          | 
 depends_lib          | text                     |           |          | 
 no_latest_link       | text                     |           |          | 
 no_package           | text                     |           |          | 
 package_name         | text                     |           |          | 
 portepoch            | text                     |           |          | 
 no_cdrom             | text                     |           |          | 
 restricted           | text                     |           |          | 
 expiration_date      | date                     |           |          | 
 is_interactive       | text                     |           |          | 
 only_for_archs       | text                     |           |          | 
 not_for_archs        | text                     |           |          | 
 status               | character(1)             |           | not null | 
 showconfig           | text                     |           |          | 
 license              | text                     |           |          | 
 fetch_depends        | text                     |           |          | 
 extract_depends      | text                     |           |          | 
 patch_depends        | text                     |           |          | 
 uses                 | text                     |           |          | 
 pkgmessage           | text                     |           |          | 
 distinfo             | text                     |           |          | 
 license_restricted   | text                     |           |          | 
 manual_package_build | text                     |           |          | 
 license_perms        | text                     |           |          | 
 pkg_plist            | text                     |           |          | 
 makefile             | text                     |           |          | 
 conflicts            | text                     |           |          | 
 conflicts_build      | text                     |           |          | 
 conflicts_install    | text                     |           |          | 
 options_name         | text                     |           |          | 
 test_depends         | text                     |           |          | 
 use_rc_subr          | text                     |           |          | 
Indexes:
    "ports_pkey" PRIMARY KEY, btree (id)
    "ports_active_idx" btree (status) WHERE status = 'A'::bpchar
    "ports_broken" btree (broken) WHERE broken <> ''::text
    "ports_category_id_idx" btree (category_id)
    "ports_date_added_idx" btree (date_added)
    "ports_deleted" btree (status) WHERE status = 'D'::bpchar
    "ports_element_id" btree (element_id)
    "ports_expiration_date" btree (expiration_date) WHERE expiration_date IS NOT NULL
    "ports_ignore" btree (ignore) WHERE ignore <> ''::text
    "ports_is_interactive" btree (is_interactive) WHERE is_interactive IS NOT NULL
    "ports_last_commit_id_idx" btree (last_commit_id)
    "ports_maintainer_idx" btree (lower(maintainer))
    "ports_master_port_idx" btree (master_port)
    "ports_package_name" btree (package_name)
    "ports_pkgmessage_english_idx" gin (to_tsvector('english'::regconfig, pkgmessage))
    "ports_pkgmessage_simple_idx" gin (to_tsvector('simple'::regconfig, pkgmessage))
    "ports_ports_expiration_date" btree (expiration_date) WHERE expiration_date IS NOT NULL
    "ports_uses_simple_idx" gin (to_tsvector('simple'::regconfig, uses))
Foreign-key constraints:
    "$1" FOREIGN KEY (category_id) REFERENCES categories(id) ON UPDATE CASCADE ON DELETE CASCADE
    "$2" FOREIGN KEY (element_id) REFERENCES element(id) ON UPDATE CASCADE ON DELETE CASCADE
    "ports_last_commit_id_fkey" FOREIGN KEY (last_commit_id) REFERENCES commit_log(id) ON UPDATE CASCADE ON DELETE SET NULL
    "ports_last_commit_id_fkey1" FOREIGN KEY (last_commit_id) REFERENCES commit_log(id) ON UPDATE CASCADE ON DELETE SET NULL
    "ports_last_commit_id_fkey2" FOREIGN KEY (last_commit_id) REFERENCES commit_log(id) ON UPDATE CASCADE ON DELETE SET NULL
    "ports_last_commit_id_fkey3" FOREIGN KEY (last_commit_id) REFERENCES commit_log(id) ON UPDATE CASCADE ON DELETE SET NULL
    "ports_last_commit_id_fkey4" FOREIGN KEY (last_commit_id) REFERENCES commit_log(id) ON UPDATE CASCADE ON DELETE SET NULL
    "ports_last_commit_id_fkey5" FOREIGN KEY (last_commit_id) REFERENCES commit_log(id) ON UPDATE CASCADE ON DELETE SET NULL
    "ports_last_commit_id_fkey6" FOREIGN KEY (last_commit_id) REFERENCES commit_log(id) ON UPDATE CASCADE ON DELETE SET NULL
    "ports_last_commit_id_fkey7" FOREIGN KEY (last_commit_id) REFERENCES commit_log(id) ON UPDATE CASCADE ON DELETE SET NULL
    "ports_last_commit_id_fkey8" FOREIGN KEY (last_commit_id) REFERENCES commit_log(id) ON UPDATE CASCADE ON DELETE SET NULL
Referenced by:
    TABLE "commit_log_ports_ignore" CONSTRAINT "$1" FOREIGN KEY (port_id) REFERENCES ports(id) ON UPDATE CASCADE ON DELETE CASCADE
    TABLE "ports_categories" CONSTRAINT "$1" FOREIGN KEY (port_id) REFERENCES ports(id) ON UPDATE CASCADE ON DELETE CASCADE
    TABLE "ports_moved" CONSTRAINT "$1" FOREIGN KEY (from_port_id) REFERENCES ports(id) ON UPDATE CASCADE ON DELETE CASCADE
    TABLE "ports_updating_ports_xref" CONSTRAINT "$1" FOREIGN KEY (port_id) REFERENCES ports(id) ON UPDATE CASCADE ON DELETE CASCADE
    TABLE "ports_vulnerable" CONSTRAINT "$1" FOREIGN KEY (port_id) REFERENCES ports(id) ON UPDATE RESTRICT ON DELETE CASCADE
    TABLE "commit_log_ports" CONSTRAINT "$2" FOREIGN KEY (port_id) REFERENCES ports(id) ON UPDATE CASCADE ON DELETE CASCADE
    TABLE "commit_log_ports_vuxml" CONSTRAINT "$2" FOREIGN KEY (port_id) REFERENCES ports(id) ON UPDATE CASCADE ON DELETE CASCADE
    TABLE "ports_moved" CONSTRAINT "$2" FOREIGN KEY (to_port_id) REFERENCES ports(id) ON UPDATE CASCADE ON DELETE CASCADE
    TABLE "commit_log_port_elements" CONSTRAINT "$3" FOREIGN KEY (port_id) REFERENCES ports(id) ON UPDATE CASCADE ON DELETE CASCADE
    TABLE "cache_clearing_ports" CONSTRAINT "cache_clearing_ports_port_id_fkey" FOREIGN KEY (port_id) REFERENCES ports(id) ON UPDATE CASCADE ON DELETE CASCADE
    TABLE "package_flavors" CONSTRAINT "package_flavors_port_id_fk" FOREIGN KEY (port_id) REFERENCES ports(id) ON UPDATE CASCADE ON DELETE CASCADE
    TABLE "package_notifications" CONSTRAINT "package_notifications_port_id_fk" FOREIGN KEY (port_id) REFERENCES ports(id) ON UPDATE CASCADE ON DELETE CASCADE
    TABLE "packages" CONSTRAINT "packages_port_id_fk" FOREIGN KEY (port_id) REFERENCES ports(id) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED
    TABLE "packages_raw" CONSTRAINT "packages_raw_port_id_fk" FOREIGN KEY (port_id) REFERENCES ports(id) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED
    TABLE "port_dependencies" CONSTRAINT "port_dependencies_port_id_dependent_upon_fkey" FOREIGN KEY (port_id_dependent_upon) REFERENCES ports(id) ON UPDATE CASCADE ON DELETE CASCADE
    TABLE "port_dependencies" CONSTRAINT "port_dependencies_port_id_fkey" FOREIGN KEY (port_id) REFERENCES ports(id) ON UPDATE CASCADE ON DELETE CASCADE
    TABLE "ports_conflicts_matches" CONSTRAINT "ports_conflicts_matches_port_id" FOREIGN KEY (port_id) REFERENCES ports(id) ON UPDATE CASCADE ON DELETE CASCADE
    TABLE "ports_conflicts" CONSTRAINT "ports_conflicts_port_id" FOREIGN KEY (port_id) REFERENCES ports(id) ON UPDATE CASCADE ON DELETE CASCADE
    TABLE "ports_origin" CONSTRAINT "ports_origin_port_id_fk" FOREIGN KEY (port_id) REFERENCES ports(id) ON UPDATE CASCADE ON DELETE CASCADE
Triggers:
freshports.org=> 
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2025-11-29 14:01 dvl New Issue