Commit Graph

9 Commits

Author SHA1 Message Date
Alexei Sorokin d01f44ee99 [DATABASE] Some query improvements
Make common_sql_weight employ standard SQL functions for the timestamp
difference in seconds.
Also replace UTC_TIMESTAMP in the MariaDB-specific part with CURRENT_TIMESTAMP
as it is the only occurence and GNU social sets UTC as a default timezone.

In a delete_orphan_files.php script simplify the main query considerably.

In clean_profiles.php stop using COUNT as if it is ANY, that is unnecessary
punishment for the database. Instead implement the anti-join with a
left outer join.

In Autocomplete and Activitypub_profile use joins instead of a WHERE OR
anti-pattern for the semi-joins.

In lib/ui/galleryaction.php replace a CROSS JOIN with an INNER JOIN.

In actions/sup.php remove a redundant subquery: WHERE is applied before
grouping either way.
2021-07-16 19:44:36 +01:00
Diogo Cordeiro 2e6c7b1bb8 [SCRIPTS] Make them work in v2 by setting PUBLICDIR 2019-08-03 17:49:11 +01:00
Mikael Nordfeldth c8753353ed Do not delete_orphan_files on an instance with Qvitter 2016-02-12 01:45:47 +01:00
Mikael Nordfeldth 913595780f And LEFT JOIN to actually get all results 2016-02-12 00:05:36 +01:00
Mikael Nordfeldth 1471defff3 ...and avoid duplicate results... 2016-02-11 23:38:12 +01:00
Mikael Nordfeldth 05fea4cdc6 Aurhg, and get all the properties, not just id 2016-02-11 22:54:29 +01:00
Mikael Nordfeldth 2198f39597 Haha, it essentially became a NOOP with the last commit 2016-02-11 22:49:45 +01:00
Mikael Nordfeldth 6f2fbd448d Fixed the delete orphan script to include deleted notices
The file_to_post table sometimes had post_id with values that did not
exist in the notice table.
2016-02-11 22:43:26 +01:00
Mikael Nordfeldth 38a187b93e Delete orphan files maintenance script
When deleting a profile it'll delete its notices and the coupling to
file entries, but not the file entries themselves (and thus not the
files). So if one to delete a person uploading offending images, then
the images are left behind and can be hotlinked. This will remove it.
2016-02-11 22:19:56 +01:00