Skip to content
Snippets Groups Projects
Commit aa6bda69 authored by Bartek Wrona's avatar Bartek Wrona
Browse files

Fixed SQL function attribute

parent ca465e5c
No related branches found
No related tags found
4 merge requests!456Release candidate v1 24,!230Setup monitoring with pghero,!135Enable postgres monitoring on CI server,!45Fixed query counting children for posts collected during sync.
......@@ -3,6 +3,8 @@
#pylint: disable=too-many-lines
import time
from time import perf_counter
import logging
import sqlalchemy
......@@ -174,12 +176,17 @@ class DbState:
index.create(engine)
time_start = perf_counter()
# Update count of all child posts (what was hold during initial sync)
sql = """
select update_hive_posts_children_count()
"""
row = DbState.db().query_row(sql)
time_end = perf_counter()
log.info("[INIT] update_hive_posts_children_count executed in %fs", time_end - time_start)
# TODO: #111
#for key in cls._all_foreign_keys():
# log.info("Create fk %s", key.name)
......
......@@ -658,9 +658,7 @@ def setup(db):
CREATE OR REPLACE FUNCTION public.update_hive_posts_children_count()
RETURNS void
LANGUAGE 'plpgsql'
COST 100
STABLE
VOLATILE
AS $BODY$
BEGIN
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment