Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does sitecore store item statistics data in database..?

i just want to know where sitecore stores Items statistics data. Using SQL query i want to get recently updated items. i write a query for Sitecore_Master database on Items table, there i found created,updated fields as well, while these columns contains different values with sitecore item statistic values my sql query is:

 select name,created,updated from items where id='{EFDC1A0B-C40D-42B9-880B-0A09D4686E60}'

it is working for me, while i need statistics data.

Anyone have idea which table sitecore used to store statistics data for sitecore item.

Thanks

like image 501
Amit Sharma Avatar asked Oct 27 '15 11:10

Amit Sharma


1 Answers

Sitecore stores Created and Updated values for every specific version of the item. That's why it's stored in the VersionedFields table.

You can use this query to get items updated after 2015-10-27:

SELECT
    vf.Value AS Updated,
    item.ID AS ItemId,
    item.Name AS ItemName
FROM
    VersionedFields vf 
    JOIN Items item ON item.ID = vf.ItemId
WHERE
    vf.FieldId = 'D9CF14B1-FA16-4BA6-9288-E8A174D4D522' -- id of the __updated field
    -- vf.FieldId = '25BED78C-4957-4165-998A-CA1B52F67497' -- id of the __created field
    AND vf.Value > '20151027'

Please keep in mind that Sitecore stores dates in UTC in the table.

like image 78
Marek Musielak Avatar answered Nov 15 '22 05:11

Marek Musielak