We have a feature class in sde that is not compressing as expected.
My understanding is that if an A row edit state is not linked to a version it is eligible for compression. So, I have made up a SQL query to find said rows.
--versions that join to states
with lina as
(select s.lineage_name
from XXXX.a106 a
join sde.states s
on a.sde_state_id = s.state_id),
linv as
(select v.owner, v.name, s.lineage_name
from sde.versions v
join sde.states s
on v.state_id = s.state_id)
select linv.owner, linv.name, count(*) as a_row_edit_num
from lina
left join linv
on linv.lineage_name = lina.lineage_name
group by linv.owner, linv.name
order by 3 desc
This query is reporting ~500,000 A rows without a version. But when I compress none are removed. Before I compress I am:
So, I am not sure what I am missing. Is there something wrong with my assumption? Or is my query flawed?
Thanks!
Hmmm...are you using eGDB replication and/or archiving? This would pin states in the Delta tables certainly. Another thing to try is to open your sde.VERSIONS and see which child VERSIONs are pointing to a State_ID of zero. Try to reconcile/post that version with DEFAULT. Keep working through this workflow until the DEFAULT version points to zero. What is the result?
Thanks fro the feedback Robert.
Sorry for the delayed response - life/work got super busy!
To your questions - in the sde.versions table, see what version is pointing to 0 by looking at the State_ID column. Default is at 316113 and other versions are at other numbers. I can't see the full table so hard to know what version is at 0. Can you sort ascending perhaps?
When you issue the compress, are all connections to the eGDB released or are there users/services still connected to the eGBD when the compress command starts?