C#, Npgsql, NpgsqlCommandBuilder and transferred data

67 views
Skip to first unread message

elmod...@gmail.com

unread,
Apr 10, 2015, 8:18:50 AM4/10/15
to npgsq...@googlegroups.com, filippo....@elmospa.com
Hi all,
I am developing a C# app that connects to a remote Postgresql database. The database size is ~50-60Mb (this is approximately the size of the "data\base" folder and the size returned by "select pg_database_size"), but if I perform a "SELECT * FROM " on all tables, the data trasferred through the LAN is ~600Mb (ten time bigger!).

I checked that most of data trasfer is due to CommandBuilder:

NpgsqlCommandBuilder cBuilder = new NpgsqlCommandBuilder(_dAdapter);
_dAdapter.DeleteCommand = cBuilder.GetDeleteCommand();
_dAdapter.InsertCommand = cBuilder.GetInsertCommand();
_dAdapter.UpdateCommand = cBuilder.GetUpdateCommand();

Where is the issue? There is a way to minimize the data transfer performing a "SELECT *" query?

Thank you, F

Emil Lenngren

unread,
Apr 10, 2015, 10:01:36 AM4/10/15
to elmod...@gmail.com, filippo....@elmospa.com, npgsq...@googlegroups.com

What types of data are you storing? Is it very many columns and rows but small amount of data in each column or do you have few columns / rows but many megabytes in each column? What may take space is the overhead for each column and row.

The size of your sql query text shouldn't matter since you only send it once.

--
You received this message because you are subscribed to the Google Groups "Npgsql Help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to npgsql-help...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/npgsql-help/1433c987-a35c-43a1-9fbc-34d6439b7397%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

elmod...@gmail.com

unread,
Apr 10, 2015, 10:28:00 AM4/10/15
to npgsq...@googlegroups.com, elmod...@gmail.com, filippo....@elmospa.com
Currently total number of rows is ~15.000. In all tables the number of columns is < 10.
Some tables contains few data (about 100 bytes per row), some other tables contains more data (about 10KB per row).
Reply all
Reply to author
Forward
0 new messages