Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
hivemind
Commits
28f1e4a5
Commit
28f1e4a5
authored
3 months ago
by
Dan Notestein
Browse files
Options
Downloads
Patches
Plain Diff
remove a bunch of unused indexes
parent
2bf98ea7
No related branches found
No related tags found
2 merge requests
!830
remove a bunch of unused indexes
,
!827
Merge develop changes to master
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hive/db/schema.py
+0
-22
0 additions, 22 deletions
hive/db/schema.py
hive/db/sql_scripts/payout_stats_view.sql
+0
-1
0 additions, 1 deletion
hive/db/sql_scripts/payout_stats_view.sql
with
0 additions
and
23 deletions
hive/db/schema.py
+
0
−
22
View file @
28f1e4a5
...
...
@@ -133,7 +133,6 @@ def build_metadata():
postgresql_where
=
sql_text
(
"
NOT is_paidout AND depth = 0 AND counter_deleted = 0
"
)),
sa
.
Index
(
'
hive_posts_payout_at_idx
'
,
'
payout_at
'
),
sa
.
Index
(
'
hive_posts_payout_idx
'
,
'
payout
'
),
sa
.
Index
(
'
hive_posts_promoted_id_idx
'
,
'
promoted
'
,
...
...
@@ -160,8 +159,6 @@ def build_metadata():
sa
.
Index
(
'
hive_posts_block_num_idx
'
,
'
block_num
'
),
sa
.
Index
(
'
hive_posts_block_num_created_idx
'
,
'
block_num_created
'
),
sa
.
Index
(
'
hive_posts_cashout_time_id_idx
'
,
'
cashout_time
'
,
'
id
'
),
sa
.
Index
(
'
hive_posts_updated_at_idx
'
,
sa
.
text
(
'
updated_at DESC
'
)),
sa
.
Index
(
'
hive_posts_payout_plus_pending_payout_id_idx
'
,
sa
.
text
(
'
(payout+pending_payout), id
'
),
...
...
@@ -279,7 +276,6 @@ def build_metadata():
sa
.
Index
(
'
hive_follows_follower_state_idx
'
,
'
follower
'
,
'
state
'
),
sa
.
Index
(
'
hive_follows_follower_following_state_idx
'
,
'
follower
'
,
'
following
'
,
'
state
'
),
sa
.
Index
(
'
hive_follows_block_num_idx
'
,
'
block_num
'
),
sa
.
Index
(
'
hive_follows_created_at_idx
'
,
'
created_at
'
),
sa
.
Index
(
'
hive_follows_follower_where_blacklisted_idx
'
,
'
follower
'
,
postgresql_where
=
sql_text
(
'
blacklisted
'
)),
sa
.
Index
(
'
hive_follows_follower_where_follow_muted_idx
'
,
'
follower
'
,
postgresql_where
=
sql_text
(
'
follow_muted
'
)),
sa
.
Index
(
'
hive_follows_follower_where_follow_blacklists_idx
'
,
'
follower
'
,
postgresql_where
=
sql_text
(
'
follow_blacklists
'
)),
...
...
@@ -299,7 +295,6 @@ def build_metadata():
sa
.
UniqueConstraint
(
'
blogger_id
'
,
'
post_id
'
,
name
=
'
hive_reblogs_ux1
'
),
# core
sa
.
Index
(
'
hive_reblogs_post_id
'
,
'
post_id
'
),
sa
.
Index
(
'
hive_reblogs_block_num_idx
'
,
'
block_num
'
),
sa
.
Index
(
'
hive_reblogs_created_at_idx
'
,
'
created_at
'
),
)
sa
.
Table
(
...
...
@@ -319,7 +314,6 @@ def build_metadata():
sa
.
ForeignKeyConstraint
([
'
post_id
'
],
[
'
hive_posts.id
'
],
name
=
'
hive_payments_fk3
'
,
deferrable
=
True
,
postgresql_not_valid
=
True
),
sa
.
Index
(
'
hive_payments_from
'
,
'
from_account
'
),
sa
.
Index
(
'
hive_payments_to
'
,
'
to_account
'
),
sa
.
Index
(
'
hive_payments_post_id
'
,
'
post_id
'
),
)
sa
.
Table
(
...
...
@@ -360,7 +354,6 @@ def build_metadata():
sa
.
Column
(
'
block_num
'
,
sa
.
Integer
,
nullable
=
False
),
sa
.
ForeignKeyConstraint
([
'
post_id
'
],
[
'
hive_posts.id
'
],
name
=
'
hive_mentions_fk1
'
,
deferrable
=
True
,
postgresql_not_valid
=
True
),
sa
.
ForeignKeyConstraint
([
'
account_id
'
],
[
'
hive_accounts.id
'
],
name
=
'
hive_mentions_fk2
'
,
deferrable
=
True
,
postgresql_not_valid
=
True
),
sa
.
Index
(
'
hive_mentions_account_id_idx
'
,
'
account_id
'
),
sa
.
UniqueConstraint
(
'
post_id
'
,
'
account_id
'
,
'
block_num
'
,
name
=
'
hive_mentions_ux1
'
),
)
...
...
@@ -445,11 +438,7 @@ def build_metadata_community(hive_rowid_seq: sa.Sequence, metadata=None):
sa
.
Column
(
'
community_id
'
,
sa
.
Integer
,
nullable
=
True
),
sa
.
Column
(
'
block_num
'
,
sa
.
Integer
,
nullable
=
False
),
sa
.
Column
(
'
payload
'
,
sa
.
Text
,
nullable
=
True
),
sa
.
Index
(
'
hive_notifs_ix1
'
,
'
dst_id
'
,
'
id
'
,
postgresql_where
=
sql_text
(
"
dst_id IS NOT NULL
"
)),
sa
.
Index
(
'
hive_notifs_ix2
'
,
'
community_id
'
,
'
id
'
,
postgresql_where
=
sql_text
(
"
community_id IS NOT NULL
"
)),
sa
.
Index
(
'
hive_notifs_ix3
'
,
'
community_id
'
,
'
type_id
'
,
'
id
'
,
postgresql_where
=
sql_text
(
"
community_id IS NOT NULL
"
)
),
sa
.
Index
(
'
hive_notifs_ix4
'
,
'
community_id
'
,
...
...
@@ -458,17 +447,6 @@ def build_metadata_community(hive_rowid_seq: sa.Sequence, metadata=None):
'
id
'
,
postgresql_where
=
sql_text
(
"
community_id IS NOT NULL AND post_id IS NOT NULL
"
),
),
sa
.
Index
(
'
hive_notifs_ix5
'
,
'
post_id
'
,
'
type_id
'
,
'
dst_id
'
,
'
src_id
'
,
postgresql_where
=
sql_text
(
"
post_id IS NOT NULL AND type_id IN (16,17)
"
),
),
# filter: dedupe
sa
.
Index
(
'
hive_notifs_ix6
'
,
'
dst_id
'
,
'
created_at
'
,
'
score
'
,
'
id
'
,
postgresql_where
=
sql_text
(
"
dst_id IS NOT NULL
"
)
),
# unread
)
sa
.
Table
(
...
...
This diff is collapsed.
Click to expand it.
hive/db/sql_scripts/payout_stats_view.sql
+
0
−
1
View file @
28f1e4a5
...
...
@@ -28,4 +28,3 @@ WITH DATA
;
CREATE
UNIQUE
INDEX
IF
NOT
EXISTS
payout_stats_view_ix1
ON
hivemind_app
.
payout_stats_view
(
community_id
,
author
);
CREATE
INDEX
IF
NOT
EXISTS
payout_stats_view_ix2
ON
hivemind_app
.
payout_stats_view
(
community_id
,
author
,
payout
);
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