query-performance

Query taking too much time in oracle: Read by other session

天涯浪子 提交于 2019-12-24 07:35:24
问题 I am working in EBS system. for a particular functionality one query is taking 99% of the time. proper index are getting used. I checked in explain plan. when I used autotrace the below statistics I got. Elapsed times include waiting on following events: Event waited on Times Max. Wait Total Waited ---------------------------------------- Waited ---------- ------------ SQL*Net message to client 1 0.00 0.00 Disk file operations I/O 1047 0.00 0.15 db file sequential read 167048 0.64 1584.33 db

postgresql with function wrap sql so slow?

为君一笑 提交于 2019-12-23 06:21:14
问题 first sql explain analyse: explain analyse select * from ttq.ttq_post; Seq Scan on ttq_post (cost=10000000000.00..10000000014.71 rows=171 width=547) (actual time=0.005..0.027 rows=176 loops=1) Planning Time: 0.033 ms Execution Time: 0.041 ms but if use function wrap the same sql eg: create or replace function ttq.test_fn_slow() returns setof ttq.ttq_post language sql stable as $$ select * from ttq.ttq_post; $$ and exec blow function: explain analyse select ttq.test_fn_slow(); result:

In clause versus OR clause performance wise

橙三吉。 提交于 2019-12-23 04:52:10
问题 I have a query as below: select * from table_1 where column_name in ('value1','value2','value3'); considering that the data in such a table may be in millions, will the below restructuring help better?? select * from table_1 where column_name = 'value1' or column_name = 'value2' or column_name ='value3'; or select * from table_1 where column_name = any ('value1','value2','value3'); I need to know performance benefits also if possible. Thanks in advance 回答1: the query doesn't matter much in

Reuse mysql Subquery in InnerJoin

不想你离开。 提交于 2019-12-22 11:21:11
问题 I'm trying optimizing a query, trying to avoid repeating the query indicated with " COMPLEX QUERY ", that is used 2 times and both, has the same results. The original query SELECT news.* FROM news INNER JOIN((SELECT myposter FROM (SELECT **COMPLEX QUERY**)) UNION (SELECT myposter FROM `profiles_old` prof2 WHERE prof2.profile_id NOT IN (SELECT **COMPLEX QUERY**))) r ON news.profile = r.p I was wondering if something like this was possible: SELECT news.* FROM (SELECT **COMPLEX QUERY**)

Should all sub queries be replaced with temporary tables?

孤街醉人 提交于 2019-12-21 21:38:58
问题 I have been working on a solution (in SQL Server) where all the sub queries with no exception have been rewritten with temp tables in order to boost performance. To give an example, all the queries like this: SELECT something FROM (SELECT * FROM T1 WHERE condition1) JOIN ... have been rewritten to be like this: SELECT * INTO #tempTable FROM T1 WHERE condition1 SELECT something FROM #tempTable JOIN ... It has also been suggested here that all sub queries should be avoided in favor of temp

Why am I seeing different index behaviour between 2 seemingly identical CosmosDb Collections

ε祈祈猫儿з 提交于 2019-12-21 16:22:15
问题 I'm trying to debug a very strange discrepency between 2 seperate cosmos db collection that on face value are configured the same. We recently modified some code that executed the following query. OLD QUERY SELECT * FROM c WHERE c.ProductId = "CODE" AND c.PartitionKey = "Manufacturer-GUID" NEW QUERY SELECT * FROM c WHERE (c.ProductId = "CODE" OR ARRAY_CONTAINS(c.ProductIdentifiers, "CODE")) AND c.PartitionKey = "Manufacturer-GUID" The introduction of that Array_Contains call in the production

Querying on Firebase Database with large data set is very very slow

妖精的绣舞 提交于 2019-12-21 05:05:34
问题 I use Firebase database on my Android app. Normally, it works fine. But when the database is getting larger, the query performance is getting worse. I added about 5k record on database (under "elk" and "su" nodes), then I queried on database (on "cut" and "user" nodes) but all the queries are very very slow. I defined data index on database rules but it did not work. How can I solve that problem? Here are my queries : // query to get the zones followed by user FirebaseDatabase.getInstance()

How to improve this MySQL Query using join?

偶尔善良 提交于 2019-12-20 02:57:06
问题 I have got a simple query and it takes more than 14 seconds. select e.title, e.date, v.name, v.city, v.region, v.country from seminar e force index for join (venueid) left join venues v on e.venueid = v.id where v.country = 'US' and v.city = 'New York' and v.region = 'NY' and e.date > curdate() and e.someid != 0 Note: count(e.id) stands for an abbreviation for debugging purposes. In fact we get information from both tables. Explain gives this: +----+-------------+-------+-------------+-------

MySQL: Select query execution and result fetch time increases with number of connections

喜欢而已 提交于 2019-12-19 09:12:11
问题 My server application makes multiple connections to MySQL through separate threads. Each connection fires a SELECT query and fetches result which the application then caters back to its connected users. I am using InnoDB. To my surprise I found it a very weird that if I increase number of connections to MySQL, query performance deteriorates and result fetch time also increases. Below is a table showing same. This data is produced when I had 3333 records in MySQL table and the SELECT query

Query performance issue for large nested data in mongodb

徘徊边缘 提交于 2019-12-18 07:09:04
问题 I'm trying to query results from a large dataset called 'tasks' containing 187297 documents which are nested into another dataset called 'workers' , that's in its turn nested into a collection called 'production_units' . production_units -> workers -> tasks (BTW this is a simplified version of production_units): [{ "_id": ObjectId("5aca27b926974863ed9f01ab"), "name": "Z", "workers": [{ "name": "X Y", "worker_number": 655, "employed": false, "_id": ObjectId("5aca27bd26974863ed9f0425"), "tasks"