database-performance

Indexing on a field and “order by” on another field

六月ゝ 毕业季﹏ 提交于 2020-01-02 15:08:16
问题 Let's assume I have a small database with three columns : "id1", "id2" and "date". I am indexing my database on the field "id1" since it is a frequently selected field (many select queries are ran with ex: where "id1" = 125548). In some particular query I have, I need to sort the records of a user based on the date" field in the table which is not indexed. My curiosity is if the sort operation (which is basically a order-by operation) on the date field will be ran on the whole database or

What makes access to OLAP Cubes / Datamarts and similar datastructures, faster than to relational databases?

限于喜欢 提交于 2020-01-02 09:55:15
问题 What makes access to OLAP Cubes/Datamarts and similar datastructures, faster than to relational databases? EDIT A bounty of 200 will be provided asap. 回答1: I would say mainly because of different purposes. OLAP cubes / datamarts are used mainly in read mode for data analysis by business users whereas I'm assuming when mentioning relational DBs you're talking about OLTP usage requiring for example ACID transactions. Those different purposes means: different constraints for the implementation

Is there any benefit to creating and index on a primary key?

情到浓时终转凉″ 提交于 2020-01-01 16:51:08
问题 I checked this SO post: What's the difference between primary key, unique key, and index in MySQL? and found the statement: Also note that columns defined as primary keys or unique keys are automatically indexed in MySQL. Based on this, I have two questions: Am I safe in assuming that there is no performance benefit to creating an index on a primary key itself because the primary key, by design, is an index? Perhaps the more important question: If you are doing the classic example people cite

Cursors on MySQL - Good or Bad

南楼画角 提交于 2020-01-01 00:50:14
问题 I have always heard people saying bad about using cursors and this is especially in Microsoft SQL Server as they are very slow. Is this the case with Cursors on MySQL as well? Does cursors in MySQL reduce performance as well? Can someone please advice on the usage of cursors in MySQL? 回答1: Most modern databases (including MySQL) are designed to perform set based operations. The problem with cursors is that they perform row based (or procedural) operations. Because of this you will almost

primary indexes Vs secondary indexes: performance differences

半世苍凉 提交于 2019-12-30 07:32:51
问题 I've got a little question: what is the difference in performance between the primary and secondary indexes? what causes this difference? I'm googling around, and I've seen that secondary indexes are stored in another table, so this slows down all operations.. but there are some other reasons that justify this decrease in performance? Thanks a lot 回答1: A clustered table is a B-Tree without "heap" portion - rows are stored directly in the B-Tree structure of the clustering index (primary key).

how to load data faster with talend and sql server

走远了吗. 提交于 2019-12-30 01:20:08
问题 I use Talend to load data into a sql-server database. It appears that the weakest point of my job is not the dataprocessing, but the effective load in my database, which is not faster than 17 rows/sec. The funny point is that I can launch 5 jobs in the same time, and they'll all load at 17rows/sec . What could explain this slowness and how could I improve the speed? Thanks New informations: The transfer speed between my desktop and the server is about 1MByte My job commits every 10 000 I use

Execute multiple functions together without losing performance

不羁的心 提交于 2019-12-29 07:31:15
问题 I have this process that has to make a series of queries, using pl/pgsql: --process: SELECT function1(); SELECT function2(); SELECT function3(); SELECT function4(); To be able to execute everything in one call, I created a process function as such: CREATE OR REPLACE FUNCTION process() RETURNS text AS $BODY$ BEGIN PERFORM function1(); PERFORM function2(); PERFORM function3(); PERFORM function4(); RETURN 'process ended'; END; $BODY$ LANGUAGE plpgsql The problem is, when I sum the time that each

How many columns is too many columns? [closed]

微笑、不失礼 提交于 2019-12-28 12:09:08
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 12 months ago . I've noticed that a lot of folks here cite tables with 20+ (I've seen as much as 55) columns in one table. Now I don't pretend to be a database design expert, but I've always heard that this is a horrible practice. When I see this, I usually suggest splitting into two

How to measure Cassandra performance in JMeter

十年热恋 提交于 2019-12-25 14:21:58
问题 I want to use JMeter to measure Cassandra response time to some queries and multiple simultaneous accesses. I'm trying to follow the instructions on this page: https://github.com/slowenthal/jmeter-cassandra First, I unpack the archive in the JMeter install directory. However when I try to access the plugin Cassandra through JMeter I can not find it. Does anyone know if I am follow the appropriate instructions? Or what can I do for everything work properly? 回答1: If you unpacked the archive

How to improve wind data SQL query performance

自作多情 提交于 2019-12-25 02:57:55
问题 I'm looking for help on how to optimize (if possible) the performance of a SQL query used for reading wind information (see below) by changing the e.g. the database structure, query or something else? I use a hosted database to store a table with more than 800,000 rows with wind information (speed and direction). New data is added each minute from an anemometer. The database is accessed using a PHP script which creates a web page for plotting the data using Google's visualization API. The web