Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dankal-data-view
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
仲光辉
dankal-data-view
Commits
50db9f8c
Commit
50db9f8c
authored
Mar 23, 2026
by
mercymodest
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add SQL script for Google Calendar notification statistics query
parent
6fac0ce3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
google-calendar-consumer-statistic.sql
01自用SQL备忘/google-calendar-consumer-statistic.sql
+44
-0
No files found.
01自用SQL备忘/google-calendar-consumer-statistic.sql
0 → 100644
View file @
50db9f8c
#
表结构
#
表结构
#
create
table
t_google_calendar_notification
#
(
#
id
bigint
not
null
comment
'ID'
#
primary
key
,
#
channel_id
varchar
(
200
)
not
null
comment
'X-Goog-Channel-ID %d-%d deviceId#thirdPartyCalendarAuthId'
,
#
device_id
bigint
null
comment
'device id'
,
#
third_party_calendar_auth_id
bigint
null
comment
'thirdPartyCalendarAuthId'
,
#
resource_id
varchar
(
200
)
not
null
comment
'Google Resource ID calendarId'
,
#
resource_state
varchar
(
32
)
not
null
comment
'Resource State'
,
#
message_number
bigint
not
null
comment
'Message Number'
,
#
resource_uri
varchar
(
512
)
not
null
comment
'Resource URI'
,
#
token
varchar
(
256
)
null
comment
'Channel Token'
,
#
expiration
varchar
(
50
)
null
comment
'Channel Expiration'
,
#
is_handled
tinyint
default
0
not
null
comment
'Is Handled (0: No, 1: Yes)'
,
#
cost
int
null
comment
'消耗时间(单位:毫秒)'
,
#
handle_time
datetime
null
comment
'Handle Time'
,
#
is_exception
tinyint
default
0
not
null
comment
'Is Exception (0: No, 1: Yes)'
,
#
exception_message
text
null
comment
'Exception Message'
,
#
create_time
datetime
default
CURRENT_TIMESTAMP
not
null
comment
'Create Time'
#
)
#
comment
'Google Calendar Notification'
charset
=
utf8mb4
;
#
#
create
index
idx_channel_id_resource_id
#
on
t_google_calendar_notification
(
channel_id
,
resource_id
);
#
#
create
index
idx_create_time
#
on
t_google_calendar_notification
(
create_time
);
#
#
create
index
idx_device_id_third_party_calendar_auth_id
#
on
t_google_calendar_notification
(
device_id
,
third_party_calendar_auth_id
);
#
#
create
index
idx_third_party_calendar_auth_id
#
on
t_google_calendar_notification
(
third_party_calendar_auth_id
);
#
##
以当前时间为基准,查询过去
24
小时(
create_time
)且
resource_state
=
'exists'
cost
前
100
到记录
SELECT
*
FROM
t_google_calendar_notification
WHERE
create_time
>=
NOW
()
-
INTERVAL
24
HOUR
AND
resource_state
=
'exists'
ORDER
BY
cost
DESC
LIMIT
500
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment