Càite an deach an t-àite air frithealaiche Confluence? No staitistig Confluence air ceanglachan

An do ruith thu a-mach à àite air an t-seirbheisiche Confluence agad a-riamh, agus nach eil fios agad cò a luchdaicheas suas na ceanglachan as motha?

Gus faighinn a-mach, feumaidh tu cothrom fhaighinn air stòr-dàta comar PostgreSQL.

A’ cleachdadh ceist SQL mu choinneamh stòr-dàta PostgreSQL, gheibh thu a-mach staitistig fheumail air Confluence.

Meud iomlan nan ceanglachan uile ann an Confluence:

SELECT s.spaceid,
       s.spacename,
       sum(LONGVAL)
FROM contentproperties c
JOIN content co ON c.contentid = co.contentid
JOIN spaces s ON co.spaceid = s.spaceid
WHERE c.contentid IN
    (SELECT contentid
     FROM content
     WHERE contenttype = 'ATTACHMENT')
  AND c.propertyname = 'FILESIZE'
GROUP BY s.spaceid
ORDER BY SUM DESC
LIMIT 5;

Toradh (ainm-fànais air a chur na àite):

Càite an deach an t-àite air frithealaiche Confluence? No staitistig Confluence air ceanglachan

Duilleagan leis a’ mhòr-chuid de dhreachan eachdraidheil còmhla:

SELECT title,
       MAX(VERSION)
FROM content
WHERE contenttype = 'PAGE'
GROUP BY title
ORDER BY 2 DESC
LIMIT 5;

Co-dhùnadh:

Càite an deach an t-àite air frithealaiche Confluence? No staitistig Confluence air ceanglachan

Na faidhlichean ceangail as motha san t-suidheachadh Confluence agad

SELECT DISTINCT c.contentid,
                c.title AS attachmentTitle,
                u.username AS uploadedBy,
                co.title AS pageTitle,
                cn.longval AS bytes
FROM CONTENT AS c
JOIN USER_MAPPING AS u ON u.user_key = c.creator
JOIN CONTENT AS co ON c.pageid = co.contentid
JOIN CONTENTPROPERTIES AS cn ON cn.contentid = c.contentid
WHERE c.contenttype = 'ATTACHMENT'
  AND cn.longval IS NOT NULL
ORDER BY cn.longval DESC
LIMIT 5;

Co-dhùnadh:

Càite an deach an t-àite air frithealaiche Confluence? No staitistig Confluence air ceanglachan

An àireamh de dhuilleagan sa bhasgaid agus meud iomlan nan duilleagan sa bhasgaid airson gach àite:


SELECT Count(content.contentid) AS number_of_trashed_pages,
       Pg_size_pretty(SUM(Pg_column_size(bodycontent.BODY))) AS trash_total_size,
       spaces.spacename AS space_name
FROM bodycontent
INNER JOIN content ON (content.contentid = bodycontent.contentid)
INNER JOIN spaces ON (content.spaceid = spaces.spaceid)
WHERE bodycontent.contentid IN
    (SELECT contentid
     FROM content
     WHERE content_status = 'deleted'
       AND contenttype = 'PAGE')
GROUP BY space_name
ORDER BY trash_total_size
LIMIT 5;

Co-dhùnadh:

Càite an deach an t-àite air frithealaiche Confluence? No staitistig Confluence air ceanglachan

Meud iomlan nan ceanglachan air an luchdachadh sìos le gach neach-cleachdaidh thar gach duilleag

SELECT u.lower_username,
       sum(cp.longval) AS "size"
FROM content c1
JOIN content c2 ON c1.contentid = c2.pageid
JOIN user_mapping u ON c1.creator=u.user_key
JOIN contentproperties cp ON c2.contentid = cp.contentid
WHERE c2.contenttype='ATTACHMENT'
GROUP BY u.lower_username
ORDER BY sum(cp.longval) DESC
LIMIT 5;

Co-dhùnadh:

Càite an deach an t-àite air frithealaiche Confluence? No staitistig Confluence air ceanglachan

PS Cuir ris a’ phost le ceistean feumail SQL airson Confluence

Source: www.habr.com

Cuir beachd ann