diff --git a/chart.png b/chart.png new file mode 100644 index 000000000..db09a130c Binary files /dev/null and b/chart.png differ diff --git a/files/perf b/files/perf new file mode 100644 index 000000000..cf99fb57c --- /dev/null +++ b/files/perf @@ -0,0 +1,11 @@ +from os import getpid +import time + +with open("/tmp/r.log", "a") as f: f.write(str(time.ctime()) + " " + str(getpid()) + " " + request.method + " " + request.full_path + "\n") +with open("/tmp/r.log", "a") as f: f.write(str(time.ctime()) + " " + str(getpid()) + " " + request.method + " " + request.full_path + " finished\n") + +from werkzeug.middleware.profiler import ProfilerMiddleware +from os import getpid +app.config['PROFILE'] = True +app.wsgi_app = ProfilerMiddleware(app.wsgi_app, profile_dir="/tmp", filename_format='{method}:{path}:{elapsed:.0f}ms:{time:.0f}:' + str(getpid()) + '.prof', stream=None) + diff --git a/schema.sql b/schema.sql index 7e1cfcfab..c9d9c6af0 100644 --- a/schema.sql +++ b/schema.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 12.8 --- Dumped by pg_dump version 12.8 (Ubuntu 12.8-0ubuntu0.20.04.1) +-- Dumped from database version 13.4 +-- Dumped by pg_dump version 13.4 (Ubuntu 13.4-1.pgdg20.04+1) SET statement_timeout = 0; SET lock_timeout = 0; @@ -41,7 +41,7 @@ CREATE EXTENSION IF NOT EXISTS pg_stat_statements WITH SCHEMA public; -- Name: EXTENSION pg_stat_statements; Type: COMMENT; Schema: -; Owner: - -- -COMMENT ON EXTENSION pg_stat_statements IS 'track execution statistics of all SQL statements executed'; +COMMENT ON EXTENSION pg_stat_statements IS 'track planning and execution statistics of all SQL statements executed'; -- @@ -356,11 +356,11 @@ CREATE TABLE public.comments ( upvotes integer, downvotes integer, is_bot boolean DEFAULT false, - is_pinned boolean DEFAULT false, app_id integer, sentto integer, bannedfor boolean, - removed_by integer + removed_by integer, + is_pinned text ); @@ -717,7 +717,6 @@ CREATE TABLE public.submissions ( over_18 boolean, distinguish_level integer, created_str character varying(255), - stickied boolean, deleted_utc integer NOT NULL, domain_ref integer, is_approved integer NOT NULL, @@ -734,7 +733,8 @@ CREATE TABLE public.submissions ( comment_count integer DEFAULT 0, processing boolean DEFAULT false, removed_by integer, - club boolean + club boolean, + stickied text ); @@ -1952,13 +1952,6 @@ CREATE INDEX submissions_created_utc_desc_idx ON public.submissions USING btree CREATE INDEX submissions_over18_index ON public.submissions USING btree (over_18); --- --- Name: submissions_sticky_index; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX submissions_sticky_index ON public.submissions USING btree (stickied); - - -- -- Name: submissions_title_trgm_idx; Type: INDEX; Schema: public; Owner: - --