Closed
Description
PostgreSQL is becoming slow as it grows.
I've made these changes to the configuration:
- Increased
shared_buffers
to 1GB, from 512MB - Reduced
random_page_cost
to 1.0, from 4.0 (this change increases the chances the planner will prefer the index over a sequential scan)
With these changes the query (found in the logs), goes from 4 minutes to 3 seconds.
SELECT time, bat as battery
FROM wsn_frame JOIN wsn_metadata ON metadata_id = wsn_metadata.id
WHERE
wsn_metadata.name IN('pf-Juvvass-4')
AND bat IS NOT NULL
AND time >= 1537286218 AND time <= 1552924618
ORDER BY time;
Regarding pf-Juvvass-4
I've found that it's slower than asking for other motes. The reason is that there're many metadatas with that name. So we should:
- Merge the
pf-Juvvass-4
and others in a similar situation. There're so many because I include the IP address in the metadata; the easy solution would be to drop that information.
The core idea here is to reduce the number of metadatas when possible.
However other queries are still slow.
Metadata
Metadata
Assignees
Labels
No labels