Storing relations in SQL base

Author Message

Vladimir Shiray

Thursday 11 August 2005 2:33:58 am

I has found that our production EZ base
contains duplicate records in the
'ezcontentobject_link' table.
I say about combination of three fields:
from_contentobject_id
from_contentobject_version
to_contentobject_id

Has it a sense?
Can it be a reson for any problem?
Is it possible to create UNIQUE key
based on these fields?

I removed duplicates in test copy with
direct SQL query:

DELETE FROM ezcontentobject_link
WHERE id NOT IN (
SELECT max(id)
FROM ezcontentobject_link
GROUP BY from_contentobject_id, from_contentobject_version, to_contentobject_id
);

Can it lead to a problem ?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 08:06:16
Script start
Timing: Jan 31 2025 08:06:16
Module start 'layout'
Timing: Jan 31 2025 08:06:16
Module start 'content'
Timing: Jan 31 2025 08:06:16
Module end 'content'
Timing: Jan 31 2025 08:06:16
Script end

Main resources:

Total runtime0.0151 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0043 588.1328151.2109
Module start 'layout' 0.00440.0020 739.343836.6484
Module start 'content' 0.00640.0071 775.992286.0313
Module end 'content' 0.01350.0016 862.023429.9922
Script end 0.0151  892.0156 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002013.3718140.0001
Check MTime0.00096.2099140.0001
Mysql Total
Database connection0.00074.600710.0007
Mysqli_queries0.002214.561830.0007
Looping result0.00000.072510.0000
Template Total0.00127.910.0012
Template load0.00095.790710.0009
Template processing0.00032.123010.0003
Override
Cache load0.00053.456410.0005
General
dbfile0.003422.740280.0004
String conversion0.00000.033140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs