query-performance

Performance is not increased even increased the work_mem size

无人久伴 提交于 2021-02-20 02:30:53
问题 I return a query which is taking Avg of 170 seconds to execute. I went through the PSQL documentation, they mentioned that if we increase work_mem the performance will increase. I increased the work_mem to 1000 MB even the performance is not improved. Note: I indexed all the field which are the part of the query. Below I am pasting the records present in the DB, query execution plan, query, result. The number of records present in the DB: event_logs=> select count(*) from events; count ------

Performance is not increased even increased the work_mem size

泄露秘密 提交于 2021-02-20 02:30:08
问题 I return a query which is taking Avg of 170 seconds to execute. I went through the PSQL documentation, they mentioned that if we increase work_mem the performance will increase. I increased the work_mem to 1000 MB even the performance is not improved. Note: I indexed all the field which are the part of the query. Below I am pasting the records present in the DB, query execution plan, query, result. The number of records present in the DB: event_logs=> select count(*) from events; count ------

Performance is not increased even increased the work_mem size

依然范特西╮ 提交于 2021-02-20 02:30:06
问题 I return a query which is taking Avg of 170 seconds to execute. I went through the PSQL documentation, they mentioned that if we increase work_mem the performance will increase. I increased the work_mem to 1000 MB even the performance is not improved. Note: I indexed all the field which are the part of the query. Below I am pasting the records present in the DB, query execution plan, query, result. The number of records present in the DB: event_logs=> select count(*) from events; count ------

Indexing Foreign Keys in Postgresql

点点圈 提交于 2021-02-19 05:59:52
问题 Like many Postgres n00bs we have a lot of tables with foreign key constraints that are not indexed. I some cases this should not be a big performance hit - but this would be subject for further analysis. I have read the following article: https://www.cybertec-postgresql.com/en/index-your-foreign-key/ And used the following query to find all foreign keys without an index: SELECT c.conrelid::regclass AS "table", /* list of key column names in order */ string_agg(a.attname, ',' ORDER BY x.n) AS

POSTGRES select n equally distributed rows by time over millions of records

[亡魂溺海] 提交于 2021-02-11 15:17:46
问题 I have a table with columns id,filter1,filter2,time,value which contains millions of records. I want to fetch n equally distributed rows between two timestamps. If the number of records between timestamps is less than n I want to fetch all the records. My current query looks like below, assuming n=200 SELECT s.* FROM ( SELECT t.time, t.value, ROW_NUMBER() OVER(ORDER BY t.time) as rnk, COUNT(*) OVER() as total_cnt FROM table_name t WHERE t.filter1='filter_value' and t.filter2='another_value'

Why is creating a new DbContext slower than a Dependency Injected one?

眉间皱痕 提交于 2021-01-28 05:38:30
问题 I recently determined that there are no significant performance gains from using a Dependency Injected DbContext in .NET Core and using async await calls as opposed to creating a new DbContext every time I want to access the DB. But now I need to know why. I did a much more granular test with System.Diagnostics.Stopwatch in my .NET Core 1.1 API services (which the controller is calling) in which I ran the stopwatch only when accessing the DB. The results were surprising. When using the

What indexes to improve performance of JOIN and GROUP BY

大城市里の小女人 提交于 2021-01-28 01:18:31
问题 I have setup some tables and ran a query. However in my explain it would appear the SQL results in a temporary table being generated ( I assume this is because of the GROUP BY) I have added some indexes to speed up the query but wondering if there was a way to stop the use of a temporary table and if there is any other way I can speed my query up using indexes? CartData CREATE TABLE `cartdata` ( `IDCartData` INT(11) NOT NULL AUTO_INCREMENT, `CartOrderref` VARCHAR(25) NOT NULL DEFAULT '',

Select workorders (via parameters) and their children

百般思念 提交于 2020-12-27 06:43:24
问题 I have a Oracle 12c query that will eventually be used in a BIRT report (in IBM's Maximo Asset Management platform). The query/report will retrieve records as follows: Retrieve workorders based on the parameters that were selected by the user. All of the parameters are optional. For testing purposes, I'm using bind variables as parameters (in Toad for Oracle). It doesn't matter if the workorders are parents, children, or neither. Of the workorders that were retrieved, also select any children