English 中文(简体)
我如何安排一个执行后来的@database级的Q。
原标题:How do I schedule an SQL to execute later @database level

---------Specification---------
Database: PostgreSQL
Language: PHP

---------Description---------
I want to create a table to store transaction log of the database. I just want to store brief information.

我认为,在大量同时执行期间,将数据(所有表格中的交易记录)加到单项记录表将出现瓶颈。

因此,我想到的是解决办法,为什么不给交易记录加上一个排队,在数据库面临重大压力时自动执行。

---------Question---------
Is there any similar facilities available in PostgreSQL. OR How can I achieve similar functionality using PHP-Cron job or any other method. Note: Execution during LOW pressure on DB is necessary

---------Thanx in advance---------

EDIT:
Definition
Heavy Pressure/heavy concurrent execution: About 500 or more query per sec on more than 10 tables concurrently.
NO heavy pressure: About 50 or less query per second on less than 5 tables concurrently.
Transaction log table: If anything is edited/inserted/deleted into any table, its detail must be INSERTED in transaction log table

问题回答

我认为,在大量同时执行期间,将数据(所有表格中的交易记录)加到单项记录表将出现瓶颈。

Don t assume. Test.
Especially when it comes to performance. Doing premature optimization is a bad thing.

还请界定“重用法”。 你们期望的每秒插入多少个字?

因此,我想到的是解决办法,为什么不给交易记录增加一个格列,在数据库面临重大压力时自动执行。

Define "no heavy pressure"? How do you find out?

我所有建议都简单地插入数据并调整《邮政总协定》,以便它能够应对负荷。

您可将数据移至单独的硬盘中,使经常业务的IO不受这一影响。 一般说来,国际交易日志限制速度,因此迅速采用10级国际开发署系统。

也许,你还需要调整检查站各部分和WAL撰写人。

但是,如果你不谈论像每秒1 000个新字的话,那么你或许不必做很多事情来做这项工作。





相关问题
摘录数据

我如何将Excel板的数据输入我的Django应用? I m将PosgreSQL数据库作为数据库。

Postgres dump of only parts of tables for a dev snapshot

On production our database is a few hundred gigabytes in size. For development and testing, we need to create snapshots of this database that are functionally equivalent, but which are only 10 or 20 ...

How to join attributes in sql select statement?

I want to join few attributes in select statement as one for example select id, (name + + surname + + age) as info from users this doesn t work, how to do it? I m using postgreSQL.

What text encoding to use?

I need to setup my PostgreSQL DB s text encoding to handle non-American English characters that you d find showing up in languages such as German, Spanish, and French. What character encoding should ...

SQL LIKE condition to check for integer?

I am using a set of SQL LIKE conditions to go through the alphabet and list all items beginning with the appropriate letter, e.g. to get all books where the title starts with the letter "A": SELECT * ...

热门标签