Bug #7409 InnoDB: function to count usage of a key as foreign key in the child tables

Submitted: 18 Dec 2004 18:05 Modified: 13 May 2010 16:04
Reporter: Zrin Ziborski Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S4 (Feature request)
Version: OS:
Assigned to: Assigned Account CPU Architecture:Any

[18 Dec 2004 18:05] Zrin Ziborski
Description:
It would be helpful to have functions like IS_USED() and/or USE_COUNT() that would tell if a value of (primary) key is used in any child table and how often it is used, respectively.

e.g.
in child table(s):
	FOREIGN KEY (some_field) REFERENCES film(flm_id)
for parent table `film`
	SELECT USE_COUNT(flm_id) FROM film;
for each row it would return the count of child rows referencing it.

How to repeat:
not applicable (feature request)

Suggested fix:
the functionality is already implemented, it seems that it is just needed to expose this functions in the API (i.e. as SQL extension).

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.038 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.