> > On 2020-06-15 22:21, Gabriel Ortiz Lour wrote: > > single COPY sql command, which is much faster than single INSERTs > > I agree with COPY on large data sets but how many CDRs are you INSERT > batching and at what intervals ? > batch=yes size=1000 time=10 on my test machine I was with this values, and sometimes it would reach the 10s, sometimes flush because of the 1000 cdrs
> > > Sounds like a small addition for having a much faster CDR insertion > > I think there are several trade-offs w/r/t PostgreSQL COPY vs. INSERT... > > 1. COPY FROM "file" is not (as easily) available if PostgreSQL and > Asterisk are running on separate servers. > COPY FROM STDIN is probably the better choice. > > 2. COPY stops on first bad record. > > 3. COPY disregards table RULEs created using the CREATE RULE PostgreSQL > language extension. > eg. it 'breaks' things like "CREATE RULE rule_insert_cdr ON INSERT TO > cdr ..." since that only works on INSERT not COPY. > > So, maybe give the user a choice, with a new option in cdr.conf and/or > cdr_pgsql.conf: > > cdr_batch_prefer_op=insert ; Default is 'insert'. > ; Other choice includes 'copy'. > ; Falls back to 'insert' if 'copy' > fails. > ; Only available on certain > backends eg. PostgreSQL. > right, would do
-- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev