Tagged Questions
1
vote
2answers
29 views
How can I tune the PostgreSQL query optimizer when using SQL logical 'OR' and operator 'LIKE'?
How can I tune the PostgreSQL query plan (or the SQL query itself) to make more optimal use of available indexes when the query contains an SQL OR condition that uses the LIKE operator instead of =?
...
-1
votes
1answer
22 views
postgresql query optimization with btree on multiple columns
I have a large table with a btree index on multiple keys. If a make a query by fixing the first two columns of the index and putting a unilateral bound on the third column, it results in a very very ...
1
vote
1answer
48 views
SQL JOIN query Optimization with subqueries
I used below subquery for get attached records. i need to know is it Optimized query for my task (seems within three month its exists records more than 10,000 ).then is it support for that data load.?
...
0
votes
1answer
25 views
run an execution plan directly in PostgreSQL
is it possible to run an execution plan directly in PostgreSQL?
I did not find anything about it after quite some search in the PostgreSQL document and on the internet.
0
votes
3answers
64 views
SQL subquery sort
Could one be so kind to assist me with a following:
I have a query that results in two columns one being straight (columnA) from a table while other generated from subquery (columnB). If I do a sort ...
2
votes
0answers
40 views
How to simplify a nested SELECT with PostgreSQL arrays? [migrated]
I'm trying to speed up and simplify a SQL query against an imported OpenStreetMap database (OSM). The database is stored in a PostgreSQL 9.2.4 server.
This OSM import features two particular tables, ...
2
votes
1answer
43 views
How to optimize querying for thousands of IDs
Here are three consecutive queries with their Benchmark performance:
ids = @Company.projects.submitted.uniq.collect(&:person_id)
1.370000 0.060000 1.430000 ( 3.763946)
@persons = ...
0
votes
1answer
47 views
PostgreSQL Aggregate groups with limit performance
I'm a newbie in PostgreSQL. Is there a way to improve execution time of the following query:
SELECT s.id, s.name, s.url,
(SELECT array_agg(p.url)
FROM (
SELECT url
...
3
votes
2answers
106 views
PostgreSQL partition query by date optimization
We have a table that has approximately one billion records per month. Considering 18 months of history we are talking about 18 billion records.
This table is partitioned weekly by date (so we have ...
0
votes
1answer
35 views
strategies to get data from diff database from diff tables
Problem
I have two databases user_works database and pricing database.
I want to take a join of two tables user_table which is in user_works
database & rent_table which is in pricing database ...
1
vote
4answers
67 views
Creating a query to find matching objects in a “join” table
I am trying to find an efficient query to find all matching objects in a "join" table.
Given an object Adopter that has many Pets, and Pets that have many Adopters through a AdopterPets join table. ...
0
votes
1answer
58 views
Spatial Join Query Optimization on Large Data Set
I have a use case where two sets of data are joined with an expensive spatial predicate. To parallelize the query I partitioned the spatial universe into tiles (in the order of thousands) such that ...
1
vote
1answer
108 views
Slow postgres query when joining large tables
I have query that's performing pretty slowly. I believe that the issue is that I'm joining across several large tables, but I still would have expected better performance. Query and EXPLAIN ANALYZE ...
0
votes
2answers
69 views
How to optimize multiply join query?
I've got a query like that
SELECT DISTINCT p.id
FROM person p
INNER JOIN person_func pf1
ON p.id = pf1.person_id
INNER JOIN Func f1
ON f1.id = pf1.func_id
LEFT JOIN ...
0
votes
2answers
133 views
Postgresql very slow query
This query runs very slow. Why? Others are fine. Indexes are good, I think.
explain analyze
select "e_inst"."si_id" as "c0"
from "e_inst" as "e_inst"
group by "e_inst"."si_id"
order by ...