[go-nuts] Re: Why doesn't the database/sql package in Go support using placeholders "?" to replace the database name and username in SQL statements?

2023-09-18 Thread Inada Naoki
Hi. I'm maintainer of go-mysql-driver. There is an option to substitute placeholders in the driver, instead of in the MySQL server. It can be used to: * Reduce roundtrip to execute a query * Avoid limitations of where placeholders can be used -- You received this message because you are subsc

[go-nuts] Re: How can I debug high garbage collection rate cause high CPU usage issue in golang

2019-06-05 Thread Inada Naoki
There are two reason GC is heavy: a) Many garbages are created very frequently. b) There are many (living) objects GC need to scan every time. (Because Go's GC is not generational) Finding bottleneck of (a) is easy. `pprof -alloc_objects ...` tell you where many objects are allocated. (b) is

[go-nuts] Re: How can stop a Read of net.Conn without closing it

2019-06-04 Thread Inada Naoki
conn.SetReadDeadline(time.Now()) -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visi

[go-nuts] Re: golang program use lots of memory

2019-02-28 Thread Inada Naoki
https://golang.org/doc/go1.12#runtime > On Linux, the runtime now uses MADV_FREE to release unused memory. This is more efficient but may result in higher reported RSS. The kernel will reclaim the unused data when it is needed. To revert to the Go 1.11 behavior (MADV_DONTNEED), set the environm

Re: [go-nuts] database/sql: NextResultSet API always return false

2019-02-01 Thread INADA Naoki
ttps://github.com/lib/pq/blob/0ac245bc3be505fde6900e1ca0f957c0845cbfa2/go18_test.go#L12 They don't intend calling `NextResultSet()` before reading first result set. They read first result set before calling NextResultSet(). So your example may be unexpected behavior (or bug) of lib/pq. Please file an

Re: [go-nuts] database/sql: NextResultSet API always return false

2019-02-01 Thread Inada Naoki
> > After reading Lutz's sample code. I found lib/pq has different semantics. > I'm not sure which is the right semantics, intended by database/sql APIs. > > https://golang.org/pkg/database/sql/driver/#RowsNextResultSet // NextResultSet advances the driver to the next result set even