SELECT doc1Groupped.maxId, doc1Groupped.maxVersion, doc2.id
FROM (
SELECT MAX(doc1.id) as maxId, MAX(doc1.version) as maxVersion
FROM doc1
GROUP BY doc1.date, doc1.title
) as doc1Groupped
JOIN doc2 ON doc1Groupped.maxId = doc2.id
WHERE doc2.id is NULL OR doc2.history = ''
$unitOfWork->getEntityChangeSet($entity);
$metaData = $entityManager->getClassMetadata(get_class($entity));
//отбираем ассоциации "не коллекции" и только изменненные.
$singleAssociations = array_filter($metaData->getAssociationNames(), function ($association) use ($metaData) {
return $metaData->isSingleValuedAssociation($association);
});
$data = [];
foreach ($changesSet as $key => $field) {
if (in_array($key, $singleAssociations)) {
// где $field[0] и $field[1] будут как раз простыми ассоциациями "до" и "после"
//getAssocFieldValue - просто метод который берет из ассоциации нужное простое значение для лога
$data[$key] = [$this->getAssocFieldValue($field[0]), $this->getAssocFieldValue($field[1])];
}
}
может индексы?
для базы в миллиарды строк я думаю это не очень спасет ситуацию.
/** @var AuthorizationCheckerInterface $authorizationChecker */
if (!$authorizationChecker->isGranted('ROLE_USER')) {
throw new AccessDeniedException();
}
/** @var AuthorizationCheckerInterface $authorizationChecker */
if (!$authorizationChecker->isGranted('IS_AUTHENTICATED_REMEMBERED')) {
throw new AccessDeniedException();
}
CA certificates
If you are going to require validation of the other side of the connection’s certificate, you need to provide a “CA certs” file, filled with the certificate chains for each issuer you are willing to trust. Again, this file just contains these chains concatenated together. For validation, Python will use the first chain it finds in the file which matches. The platform’s certificates file can be used by calling SSLContext.load_default_certs(), this is done automatically with create_default_context().
SSLContext.load_default_certs(purpose=Purpose.SERVER_AUTH)¶
Load a set of default “certification authority” (CA) certificates from default locations. On Windows it loads CA certs from the CA and ROOT system stores. On other systems it calls SSLContext.set_default_verify_paths(). In the future the method may load CA certificates from other locations, too.
The purpose flag specifies what kind of CA certificates are loaded. The default settings Purpose.SERVER_AUTH loads certificates, that are flagged and trusted for TLS web server authentication (client side sockets). Purpose.CLIENT_AUTH loads CA certificates for client certificate verification on the server side.