Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Container registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
videoag
backend
Commits
26711323
Commit
26711323
authored
2 months ago
by
Simon Künzel
Browse files
Options
Downloads
Patches
Plain Diff
Make migrate stats faster and fix missing delete
parent
573bf1a5
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/migrate_stats.sql
+3
-0
3 additions, 0 deletions
api/migrate_stats.sql
with
3 additions
and
0 deletions
api/migrate_stats.sql
+
3
−
0
View file @
26711323
DELETE
FROM
lecture_daily_watch_stats
;
DELETE
FROM
lecture_daily_watch_stats
;
DELETE
FROM
lecture_watch_stats
;
DELETE
FROM
lecture_watch_stats
;
DELETE
FROM
publish_medium_watch_stats
;
DELETE
FROM
unknown_video
;
DELETE
FROM
unknown_video
;
CREATE
OR
REPLACE
PROCEDURE
temp_count_lecture_view
(
lec_id
int
,
watch_timestamp
timestamp
)
AS
$$
CREATE
OR
REPLACE
PROCEDURE
temp_count_lecture_view
(
lec_id
int
,
watch_timestamp
timestamp
)
AS
$$
...
@@ -58,6 +59,7 @@ DO $$
...
@@ -58,6 +59,7 @@ DO $$
IF
processed_count
%
10000
=
0
THEN
IF
processed_count
%
10000
=
0
THEN
RAISE
NOTICE
'(hlslog) Processed %/% (% %%)'
,
processed_count
,
total_processing_count
,
(
processed_count
::
double
precision
/
total_processing_count
*
100
)::
int
;
RAISE
NOTICE
'(hlslog) Processed %/% (% %%)'
,
processed_count
,
total_processing_count
,
(
processed_count
::
double
precision
/
total_processing_count
*
100
)::
int
;
COMMIT
;
END
IF
;
END
IF
;
SELECT
processed_count
+
1
INTO
processed_count
;
SELECT
processed_count
+
1
INTO
processed_count
;
...
@@ -91,6 +93,7 @@ DO $$
...
@@ -91,6 +93,7 @@ DO $$
IF
processed_count
%
10000
=
0
THEN
IF
processed_count
%
10000
=
0
THEN
RAISE
NOTICE
'(log) Processed %/% (% %%)'
,
processed_count
,
total_processing_count
,
(
processed_count
::
double
precision
/
total_processing_count
*
100
)::
int
;
RAISE
NOTICE
'(log) Processed %/% (% %%)'
,
processed_count
,
total_processing_count
,
(
processed_count
::
double
precision
/
total_processing_count
*
100
)::
int
;
COMMIT
;
END
IF
;
END
IF
;
SELECT
processed_count
+
1
INTO
processed_count
;
SELECT
processed_count
+
1
INTO
processed_count
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment