indexing

ode solver event location index in MATLAB

瘦欲@ 提交于 2019-12-24 01:53:41
问题 Suppose I am trying to solve a system of differential equations using an ode solver in MATLAB. Suppose also that I have defined an events functions to locate three different events which are all terminal. I have noticed that on some occasions the ie quantity that is returned upon the location of one of the events ( ie is the index of the event that stopped the solver, in my case it could be 1, 2 or 3) is not always a single number but a vector with two elements (usually these elements are

Searching on expression indexes

北战南征 提交于 2019-12-24 01:37:28
问题 Searching on expression indexes I'm building an expression index that substrings a source field to avoid overflowing the 2172 character limit on B-trees: CREATE INDEX record_changes_log_detail_old_value_ix_btree ON record_changes_log_detail USING btree ((substring(old_value,1,1024)::text) text_pattern_ops); For the record: -- Postgres 11.4 on RDS, 11.5 on macOS at home. -- The record_changes_log_detail table has about 8M in my test setup. -- The old_value field is of type citext. -- Values in

Excel - SUMIF INDEX and MATCH

若如初见. 提交于 2019-12-24 01:29:15
问题 I'm stuck with a sumif formula. I think if I used some mix of index and match I could get it to work but I've been unable to do so for the past hour! I need to sum from a table of numbers depending on the house number and 2 dates. For example, I need to sum the numbers for house 1 between dates 08-05-17 and 13-05-17. My previous experience with index and match is that I've only every used it to get a single specific digit. 回答1: OFFSET and INDIRECT are volatile, this is possible with INDEX

SQL Server 2008: Disable index on one particular table partition

↘锁芯ラ 提交于 2019-12-24 01:05:33
问题 I am working with a big table (~100.000.000 rows) in SQL Server 2008. Frequently, I need to add and remove batches of ~30.000.000 rows to and from this table. Currently, before loading a large batch into the table, I disable indexes, I insert the data, then I rebuild the index. I have measured this to be the fastest approach. Since recently, I am considering implementing table partitioning on this table to increase speed. I will partition the table according to my batches. My question, will

cannot apply indexing with [] to an expression

帅比萌擦擦* 提交于 2019-12-24 00:59:09
问题 var dbPerson = from p in db.People where p.Id == PersonId select p; dbPerson[0].HolidaysRemaining--; is throwing me an error with dbPerson[0] saying cannot apply indexing with [] to an expression of type 'system.linq.lqueryable,holidayBookingApp.model.person> can someone please advise how I can resolve this? Thanks 回答1: To get the first item that your query dbPerson returns, use var firstPerson = dbPerson.First(); or Single if you only expect one match and want an exception to be thrown if

Postgres uses wrong index in query plan

痴心易碎 提交于 2019-12-24 00:59:02
问题 Below I have 2 almost identical queries, only the limit is different. Nevertheless, the query plan and execution time are totally different. The first query is +300 times slower than the second one. The problem only occurs for a small number of owner_ids. Owners with many routes (+1000), none of which has recently been edited. The table route contains 2,806,976 rows. The owner in the example has 4,510 routes. The database is hosted on Amazon RDS on a server with 34.2 GiB memory, 4vCPU and

In MySQL how to set index to the table?

被刻印的时光 ゝ 提交于 2019-12-24 00:56:35
问题 In MySQL how to use the Index concept for MySQL tables. 回答1: Syntax for adding index to existing table. ALTER TABLE table_name ADD INDEX column_name A simple example CREATE TABLE employee_records (name VARCHAR(50), employeeID INT); CREATE INDEX id_index ON employee_records(employeeID); creating index while creating table CREATE TABLE employee_records ( name VARCHAR(50), employeeID INT, INDEX (employeeID) ); 回答2: To add an index to a table in MySQL: ALTER TABLE [table name] ADD INDEX ([column

Perform calculation between rows with datetime index and place them into new columns

若如初见. 提交于 2019-12-24 00:54:23
问题 I have a dataframe, produced by this piece of code: import pandas as pd import datetime as dt datarange=pd.date_range('01-05-2018 00:00:00', periods=50, freq="4H") range_series_1=pd.Series(np.random.randint(-5,3,size=50).astype(float), index=datarange) range_series_2=pd.Series(np.random.randint(5,9,size=50).astype(float), index=datarange) frame=pd.DataFrame({'value1':range_series_1, 'value2':range_series_2}) frame.index.name='datetime' I need two extra columns (e.g. 'column 1' and 'column 2')

Mysql optimization based on explain

被刻印的时光 ゝ 提交于 2019-12-24 00:44:50
问题 I have the following query that takes a really long time to execute. I need to speed it up, but I'm at a lost as to what technique to use. This is the query: SELECT `User`.`id`, `User`.`username`, `User`.`password`, `User`.`role`, `User`.`created`, `User`.`modified`, `User`.`email`, `User`.`other_user_id`, `User`.`first_name`, `User`.`last_name`, `User`.`place_id`, `Resume`.`id`, `Resume`.`user_id`, `Resume`.`other_resume_id`, `Resume`.`other_user_id`, `Resume`.`file_extension`, `Resume`.

Why doesn't MySql automatically optimises BETWEEN query?

半世苍凉 提交于 2019-12-24 00:37:52
问题 I have two query for same output Slow Query: SELECT * FROM account_range WHERE is_active = 1 AND '8033576667466317' BETWEEN range_start AND range_end; Execution Time: ~800 ms . Explain: +----+-------------+---------------+------------+------+-------------------------------------------+------+---------+------+--------+----------+-------------+ | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +----+-------------+---------------+---