All Questions
Tagged with postgresql performance
29 questions
0
votes
1
answer
66
views
Find and conditionally sort all venues matching a filter provided by an API client in PostgreSQL
I have an API where users can retrieve a list of "venues".
Every venue is a profile, but not every profile is a venue
Venues can be "parents" of other venues (think hotel - floor -...
3
votes
0
answers
58
views
Django migration script to add metadata
I made a simple django migration that adds two field to our Invoices model : first_payment and first_paying_month.
...
4
votes
0
answers
112
views
Interacting with PostgreSQL attachment and the file system
I have just migrated from Python 2 to Python 3. I have written the following script to fetch all records of a table, ir_attachment, from PostgreSQL. After fetching all the records I check following ...
1
vote
1
answer
210
views
Reading employee data from a PostgreSQL database
I have developed this script to read employee_language table records of a PostgreSQL database using Python 2 (due to some OS limitation). I want to find duplicate ...
3
votes
1
answer
59
views
Enforcing a constraint that a user may vote on each post at most once
I have the following table in a PostgreSQL database:
...
3
votes
1
answer
69
views
Python script to find employees who are in one PostgreSQL table but not in another
I'm writing a python script and do database query to get the ids of employees who are in one table but are not in another. I'm using psycopg2 module for python 2 and PostgreSQL as database. After ...
3
votes
0
answers
1k
views
PL/pgSQL function to test if a word is contained within a phrase
I am using PostgreSQL 11.0 and I wrote a PL/pgSQL function to test if a word or phrase is contained within another phrase. This function is called several times within another function to extract some ...
1
vote
1
answer
163
views
slow JavaFx PostgreSQL CRUD app with complex object
I've created a JavaFX app to the data about Vessels, Employees and Jobs. The current version works but it is quite slow which I need to fix. I understand the root of my problems but I do not know how ...
3
votes
1
answer
59
views
Iterate between dates and INSERT values in a performant way
I have created a query that populates a datapoint with random values.
The logic is simple: Iterate between the START and END dates and INSERT random values.
I want from this query to be very ...
2
votes
1
answer
616
views
Offset vs Cursor Pagination
I am trying to compare any performance gain(s) from moving a current offset-based pagination endpoint to a cursor based one.
I have the following ruby code:
...
2
votes
4
answers
2k
views
C# SQL query builder to fill DataTable
I'm trying to optimize my code and in the process of doing that I made a class Query_builder that handles SQL queries. That class has couple of methods: ...
0
votes
1
answer
56
views
Count buffered streets that intersect buffered points using PostGIS
PostgreSQL 9.5.1 with PostGIS 2.0 extension
This first section creates an intersection (clip) of the streets from another polygon (MTC15), then it buffers the intersection:
...
2
votes
1
answer
231
views
Listing employees, categorized by license expiration date
I am working on a personal project and I have hit a wall. I know I am writing bad code and I really want to refactor the code below. The application has three tables on the same page. Each table ...
2
votes
1
answer
803
views
Parsing data from big json field and geocode services then store to PostgreSQL using psycopg2 instead django-orm
This code works, but my boss told me that it's very bad code, and don't want to deploy it. It is my first time working as a programmer and I have at least 3 months of experience.
...
2
votes
2
answers
2k
views
Database migration script
I'm working on a database migration script written in python, which will take data from a MySQL database and insert them into a PostgreSQL database with a different Schema (different table structures, ...