Skip to content

DOC: df.to_sql chunksize seems to be ignored by default. #35891

Closed
@gbrova

Description

@gbrova

Location of the documentation

https://dev.pandas.io/docs/reference/api/pandas.DataFrame.to_sql.html

Documentation problem

Docs for chunksize state that "By default, all rows will be written at once". However, this seems to only be true if method="multi", even though method=None by default.

Experimentally, I notice a substantial speedup if I set method="multi" and chunksize is either unset or large, but chunksize seems to have no effect if I don't set method.

Suggested fix for documentation

Documentation for chunksize should also reference the method argument. For example. we could revise to:

chunksize : int, optional
Specify the number of rows in each batch to be written at a time, if batching is enabled via method. By default, all rows will be written at once.

Also, are there many uses where users should avoid method="multi"? If not, would it make sense to change the default?

Metadata

Metadata

Assignees

Labels

DocsIO SQLto_sql, read_sql, read_sql_query

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions