Tag Info

New answers tagged

0

It depends a lot on what the data is, what you're doing with the data, what the bandwidth between client and server is, what stored procedure language you're using, etc. Test it and see. You can: Use the psql \timing command to get the final execution time including results transfer from the client perspective; Use log_min_duration_statement = 0 in ...


0

VACUUM FULL takes an ACCESS EXCLUSIVE lock on the table, then rewrites the whole table. This will take a long time for a large table, especially since it must also rebuild all indexes. You haven't said anything about the table size or the server's I/O subsystem so it's hard to say if 5 hours is unexpected or not. You shouldn't generally need to use VACUUM ...


0

Please read the user manual section on client authentication. You must ensure that you're using a user account that actually exists in PostgreSQL; the "localhost server password" is unlikely to be the password for your user account in PostgreSQL unless you set it up that way. The message fe_sendauth: no password supplied suggests that you did not enter a ...


2

With the comment from FrustratedWithFormsDesigner, I came to the following solution: SELECT subq2.*, sum(new_group) OVER (ORDER BY t ASC) AS group_id FROM ( SELECT subq.*, CASE WHEN delta > 1500 THEN 1 ELSE 0 END AS new_group FROM ( SELECT t, lag(t) over (ORDER BY t ASC), t - lag(t) over (ORDER BY t ASC) AS delta FROM time_points ) AS ...


1

If it is sufficient that the group boundaries be arbitrary time periods (like 1000000-10001499, 10001500-10002999, ...) then GROUP BY int_timestamp/1500 should do, and you can take MIN(int_timestamp) as the ID for the group. Or are you actually trying to output the whole rows grouped by 1500ms instead of just aggregates of the groupings? It would be helpful ...


3

I would store the timestamp, server identifier, and number of players in just the way you thought of, deleting the oldest (if you need to) and adding new ones every 15 minutes. Moving the server names into another "server" table and referencing the primary key in your player count table would be a more conventional normalised design. With reference to the ...


2

You are trying to connect to the database as your user but that use doesn't exists. The best way to execute administrative commands on PostgreSQL is to issue them as the "postgres" user. Change user with: sudo su - postgres The user postgres exists and has administrative privileges (it is a superuser) so can connect the database and create new users ...



Top 50 recent answers are included