psql

How can I speed up Django Query aggregations on a 10 million row database with 60 features?

How can I speed up Django Query aggregations on a 10 million row database with 60 features? Question: I have a database table in psql which contains of 10,000,000 rows and 60 columns (features). I define a Django Queryset as follows: MyQ=MyDataBase.objects.filter(Name=’Mike’, date=date(2018, 2, 11), Class=’03’) There are only 5 rows that satisfy the above …

Total answers: 2

pg_dump & pg_restore password using python module subprocess

pg_dump & pg_restore password using python module subprocess Question: Problem: Use the PSQL pg_dump and pg_restore in a Python script and using the subprocess module. Background: I am using the following python 2.7 script from the localhost (i.e. Ubuntu 14.04.5 LTS) to create a backup of a table in a PSQL server (i.e. PostgreSQL 9.4.11) …

Total answers: 4

Install psycopg2 for Anaconda Python

Install psycopg2 for Anaconda Python Question: I have Anaconda Python 3.4, however whenever I run older code I switch to Anaconda Python 2.7 by typing “source activate python2”. My issue is that I have psycopg2 installed for Anaconda Python 3.4, but not for Anaconda Python 2.7. When I run pip install psycopg2 (on Python 2.7) …

Total answers: 5