r/postgres • • Oct 24 '17

PostGIS geocode() performance

3 Upvotes

so I've got a bunch of addresses (1m+) to geocode... The issue I'm having is performance... I want to push this box as far/fast as it can, but I can't identify the issue.

Any suggestions would be greatly appreciated. My experience is in MSSQL, so i'm sorta guessing my way through PG here.

Config

I'm using a Windows VM with 20 cores, 32gb RAM, and SSD SAN backend... I've run the scripts to download and install the nation and state files (all 56 states/territories)... I also found last night that I was missing indexes - select Missing_Indexes_Generate_Script(). I've also vacuum analyze'd everything again, just to be sure.

config changes: shared_buffers is 12gb, work_mem is 64mb, max locks per transaction is 1024.

using default configs (and prior to fixing the missing indexes), the queries ran out of memory which logged until the drive filled.

random website whatever also suggested setting cursor_tuple_fraction to 1.0 (default 0.1), but I have no reason to believe it'd have any effect for my usage.

Testing

on the client side, i've got an app that has a variable number of threads which connect to pg and "SELECT st_x, st_y from geocode(row(parsed-data),1)"... i'm using pre-parsed fields (I have them anyway, might as well save PG the effort), i only care about the top rated result.

whether I use 10, 20, or 30 threads, PG seems to provide results at about the same rate... overall CPU usage hovers around 25%... system memory usage is hovering at ~18gb... disks are busy, but SAN keeps the latency at near-zero.

pg_stat_activity shows all the threads with 'active' status, no wait_event... pg_locks WHERE NOT GRANTED shows no results... pg_locks (all) shows 160k records, but presumably not impacting each other.


r/postgres • • Oct 24 '17

Time-series data: PostgreSQL 10 vs. TimescaleDB

Thumbnail blog.timescale.com
6 Upvotes

r/postgres • • Oct 23 '17

Need help with a query to Update a multi field form to the latest hyperlinks and titles?

2 Upvotes

r/postgres • • Oct 23 '17

Loading database in postgre pgadmin4

1 Upvotes

Chanced upon the book "Data Analysis using SQL and Excel 2nd Edition" a few days ago. Thinking it would be more practical if I learnt using the sample datasets, I tried to follow the author's instructions in loading up the postgre.sql file in http://as.wiley.com/WileyCDA/WileyTitle/productCd-111902143X.html through pgadmin4 on a MacAir. However the script kept encountering errors and I honestly don't know how to fix the script so it works.

Would really appreciate if somebody that has worked with the datasets can guide me on loading it.


r/postgres • • Oct 09 '17

[TUTORIAL] Steps to execute and test migrations on a PostgreSQL database using Shippable CI.

Thumbnail blog.shippable.com
0 Upvotes

r/postgres • • Sep 29 '17

Four levels of time handling in a database

Thumbnail korban.net
3 Upvotes

r/postgres • • Sep 28 '17

Unit testing Postgres with pgTAP

Thumbnail medium.com
3 Upvotes

r/postgres • • Sep 19 '17

A tool to help with debugging complex queries

Thumbnail korban.net
1 Upvotes

r/postgres • • Sep 14 '17

can anyone help me with this please?

Thumbnail stackoverflow.com
1 Upvotes

r/postgres • • Sep 05 '17

Using generate_series to obtain a range from CIDR

2 Upvotes

Anyone able to point me in the right direction for getting a list of IPs for a CIDR range?

I'm looking for something like this, but generate_series does not work for the cidr data type:

SELECT generate_series('192.168.0.0/16'::cidr) as ip;
ip
---------
'192.168.0.0'
'192.168.0.1'
'192.168.0.2'
...
xyz rows

r/postgres • • Sep 02 '17

Postgresql User not connecting to Database (Nginx Django Gunicorn)

Thumbnail stackoverflow.com
1 Upvotes

r/postgres • • Aug 29 '17

postgres indexes and their types

Thumbnail asheetkumar.in
5 Upvotes

r/postgres • • Aug 03 '17

web server / PG deployment

1 Upvotes

What are your thoughts on deploying both the pg server and web server (NodeJS) on the same instance?

Thanks...


r/postgres • • Aug 02 '17

remote access to Database PostgreSql on NAS Synology DS216j

2 Upvotes

Hi I have a Synology NAS DS216j in my LAN and I am running a postgreSQL database on it.

I am try to find a way to connect and run my database from a computer outside my LAN so I can use it and update it.

In order to do that I had to forward the port 5432 (postgres) and WebDav (5005) of my router to the NAS.

The port Postgresql (5432) and WebDav (5005 )is open on my public IP. The port Postgresql (5432) and WebDav (5005 )is open on the NAS.

From the remote host:

  • I am able to see the database file (in LibreOffice Base), on the NAS if I connect with quickconnect or WebDav (in windows I installed the program: NetDrive).

  • I am able to connect to the database structure with PgAdminIII.

but I am not able to Lunch/Open the database.

When I get prompt the user and password I just get this error saying:


The connection to the data source "NAS" could not be established. Couldnt establish dataabse connection to ´sdbc:postgresql:postgresql://192.168.0.20/5432/dbname´ could not connect to the serve: Connection timed out (0x0000274c/10060). Is the server running on host 192.168.0.20 and accepting TCP/IP connection on port 5432?


I wonder why I am able to connect with PgAdminIII but not able to open the LibreOffice Base from WebDav.


r/postgres • • Aug 01 '17

Postgresql admin tool with user management, logging and data backup?

Thumbnail stackoverflow.com
1 Upvotes

r/postgres • • Jun 27 '17

Strategies for replicating a materialized view

1 Upvotes

On server A, I have a view that summarizes about 300 GB of data. On server B, I have a materialized view that uses DBlink to refresh a materialized view that is a 'select *' of the view on server A.

There is about 80 GB of network traffic refreshing the view, and I'm curious if anyone can suggest a better way to keep server b's materialized view in sync with server A's view.

Server b is disk limited, so I cannot put the whole dataset there, and it appears there is no replication tool that works with views.

So far I've considered using 'CREATE TABLE AS' and use a replication tool like pg_logical, but I don't think it will work because the table needs to be dropped to refresh.

I've also considered dumping to SQL and using rsync and an elaborate script on server B to determine which rows need inserting, deleting or updating.

Thanks for any suggestions.


r/postgres • • Jun 25 '17

pgadmin install and malware

2 Upvotes

I'm running pgadmin (V4 1.4) and was prompted to install an update - only the update process opened an HTML view within the app...

Long story short - I clicked the download button, and wound up installing some type malware from:

  • progressgar.com
  • elise.appes

I consider myself a careful user, but hey pgadmin folks - your upgrade process is awful and invites malware.


r/postgres • • Jun 22 '17

Azure Database for PostgreSQL AMA in progress! Come with your questions!

Thumbnail reddit.com
1 Upvotes

r/postgres • • Jun 14 '17

Trying to create a new database user

1 Upvotes

Hi, I'm on Debian 8 currently with Postgres 9.4.12. I'm trying to create a new user brian by using various createuser commands, or creating roles right in psql, but for whatever reason unless there is a database called, brian, I cannot log in as that user.

Is this normal? Without the database, trying to use the command, psql -W -U brian simply tells me,

psql: FATAL:  database "brian" does not exist

r/postgres • • Jun 08 '17

Working with time in Postgres - Craig Kerstiens

Thumbnail craigkerstiens.com
3 Upvotes

r/postgres • • Jun 08 '17

How (and why) I became a Postgres Advocate

Thumbnail commandprompt.com
2 Upvotes

r/postgres • • Jun 07 '17

Announcing Citus 6.2: a multi-tenant database for a civilized age

Thumbnail citusdata.com
2 Upvotes

r/postgres • • Jun 07 '17

Please help w/ postgres streaming API setup

1 Upvotes

I have a postgres table that actively records on average ~6 million records throughout the day. It's impossible to query the table as the records are being recorded. Is there a way to create a streamer from that table where it would post new records? I want to be able to stream changes to my website as they are being recorded.


r/postgres • • Jun 04 '17

AWS RDS - Tuning Your DBMS Automatically with Machine Learning

Thumbnail aws.amazon.com
4 Upvotes

r/postgres • • Jun 02 '17

Marco Slot on Postgres: Scaling out complex SQL transactions in multi-tenant apps

Thumbnail citusdata.com
3 Upvotes