mirror of
https://codeberg.org/demostf/db.git
synced 2026-06-03 10:04:10 +02:00
create materialized view for nickname search
This commit is contained in:
parent
89bba977cd
commit
8c29e0fe41
1 changed files with 8 additions and 0 deletions
|
|
@ -554,6 +554,14 @@ CREATE MATERIALIZED VIEW map_list AS
|
||||||
GROUP BY clean_map_name(map)
|
GROUP BY clean_map_name(map)
|
||||||
ORDER BY count DESC;
|
ORDER BY count DESC;
|
||||||
|
|
||||||
|
CREATE MATERIALIZED VIEW name_list AS
|
||||||
|
SELECT user_id, p.name, count(demo_id) AS count, steamid
|
||||||
|
FROM players p
|
||||||
|
INNER JOIN users u ON u.id=p.user_id
|
||||||
|
GROUP BY p.name, user_id, steamid;
|
||||||
|
|
||||||
|
CREATE INDEX alias_name_trgm_idx ON name_list USING GIN (name gin_trgm_ops);
|
||||||
|
|
||||||
--
|
--
|
||||||
-- PostgreSQL database dump complete
|
-- PostgreSQL database dump complete
|
||||||
--
|
--
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue