-
Notifications
You must be signed in to change notification settings - Fork 3
Ideas for improving AATAMS' performance #72
Comments
An outage which just happened was possibly (likely) caused by materialised view refresh. |
I'm not sure if I've made it clear enough in the past w.r.t. to the seriousness of this issue. There are two main problems occurring as a result of the issues list above:
|
I just prototyped (1) from above (loading detections using I was able to load ~3.5M detections in around 11s (~300k records/s) - this is around 1500x as fast as the web app currently loads detections (including all the validation and what not). FWIW, we could re-load every uploaded detection (~90M) in around 5 minutes this way :-) |
To be fairer, I added a compound index and a primary key constraint. It takes now ~40s to load 3.5M records - still fast enough. Table definition: -- Table: raw_det
-- DROP TABLE raw_det;
CREATE TABLE raw_det
(
"timestamp" timestamp with time zone,
receiver_name text,
transmitter_id text,
id bigint NOT NULL,
CONSTRAINT raw_det_pkey PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);
ALTER TABLE raw_det
OWNER TO aatams;
-- Index: pagination_index
-- DROP INDEX pagination_index;
CREATE INDEX pagination_index
ON raw_det
USING btree
("timestamp", receiver_name COLLATE pg_catalog."default", transmitter_id COLLATE pg_catalog."default");
COPY raw_det
FROM PROGRAM 'awk -F, ''{$(NF+1)=++i;}1'' OFS=, /tmp/big_dets.csv'
CSV HEADER DELIMITER ',';
|
Note that in 1), the file would have to exist on the same server as the DB. Possibly, rather than storing the file on disk, we could store it in the DB (as a BLOB or some such), and This would also simplify deployment and backups somewhat (because only the DB has state, not DB + filesystem). |
Ref: #71
We should be able to speed things up and simplify the code a lot by implementing some of the following recommendations. My initial (but brief) prototyping has demonstrated that the following suggestions are feasible.
COPY
commandrescanForDeployment
The text was updated successfully, but these errors were encountered: