OnLine SLOW! ??
Posted in 1995
My SE engine runs "quickly" with a report from a table with columns having a referential constraint (foreign key) but OnLine slows to a crawl with the same report - 6 seconds vs 36 seconds! I use the referential constraint to enforce data integrity in two columns of a table which requires unique data pairs in those columns, although the same pair can occur again and again in that table's entries. (like example on page 7-81 of "Guide to SQL - Reference", 9/92) I can duplicate the same long report duration by removing the foreign key and creating an index on the pair of columns. I understand that the foreign key constraint creates an index on the columns, so this makes SOME sense. There are only two tables involved in this report, TABLE A (with all the data I want) and TABLE B providing the two columns of unique data pairs that must appear in the two columns of TABLE A. My initial reaction was WHY is the foreign key constraint affecting a simple report, when I'm not attempting to enter/modify data in the controlled columns --- I'm just reading data from a single table -- no joins, etc.! However, it appears that the indexing enforced by the foreign key constraint is causing the long report time and I'd like to know how to get around this while maintaining my constraint. I've tried "update statistics", etc. with no success! Any help would be greatly appreciated! Thanks, Jim -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ## ####### ## ## Jim Kistler ## ## ## ## kistler@hp-and.an.hp.com ## ## ## ## Hewlett-Packard Co. ## ##### #### Imaging Systems ## ## ## ## ## 3000 Minuteman Road ## ## ## ## ## Andover, MA 01810 ######## ## ## ## TEL: 508-659-2251 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~FAX: 508-687-7265~~~~~~~~~~