Details
-
Bug
-
Resolution: Fixed
-
High
-
None
-
None
Description
JAC keeps issuing this query
SELECT ID, pkey, PROJECT, REPORTER, ASSIGNEE, issuetype, SUMMARY, DESCRIPTION, ENVIRONMENT, PRIORITY, RESOLUTION, issuestatus, CREATED, UPDATED, DUEDATE, VOTES, TIMEORIGINALESTIMATE, TIMEESTIMATE, TIMESPENT, WORKFLOW_ID, SECURITY, FIXFOR, COMPONENT FROM public.jiraissue WHERE pkey IS NULL
Which is expensive
atljira=# explain SELECT ID, pkey, PROJECT, REPORTER, ASSIGNEE, issuetype, SUMMARY, DESCRIPTION, ENVIRONMENT, PRIORITY, RESOLUTION, issuestatus, CREATED, UPDATED, DUEDATE, VOTES, TIMEORIGINALESTIMATE, TIMEESTIMATE, TIMESPENT, WORKFLOW_ID, SECURITY, FIXFOR, COMPONENT FROM public.jiraissue WHERE pkey IS NULL; QUERY PLAN --------------------------------------------------------------- Seq Scan on jiraissue (cost=0.00..12545.51 rows=1 width=669) Filter: (pkey IS NULL) (2 rows)
And always returns no results
jac_production_user=# select count(*) from jiraissue where pkey is null; count ------- 0 (1 row)
and shouldn't ever return any results because an issue cannot exist without an issue key (? is this true), so the schema should probably reflect that
jac_production_user=# \d jiraissue Table "public.jiraissue" Column | Type | Modifiers ----------------------+--------------------------+----------- id | numeric(18,0) | not null pkey | character varying(255) |
as well as an UNIQUE index created on that column to enforce that constraint