34,564 questions
-1
votes
2
answers
66
views
How to filter a pandas object type column using an array for indexing
I im trying to extract a title from the famous "Titanic" dataset, where the format is like this:
[Name]
[1]: https://i.sstatic.net/HlkH8zHO.png
I'm trying to avoid an iterative solution, so ...
1
vote
2
answers
215
views
Copy and paste indexed words maintaining unique index
I am trying to figure how to index every word in a text box and maintain these indexes when the text is copy and pasted (into another text area). The problem I am facing is giving each word a unique ...
1
vote
1
answer
57
views
If value matches x, enter new value into another table using row and column matches
I'm using Excel 365 and trying to take advantage of VisualBasic for this query. I'm working with two tables where if Table: EventDiary[Match] = 1 then I want to enter the [Actual] value (-30) into ...
0
votes
1
answer
50
views
Mysql multi-column indexes approach when table used twice in one query
I have mysql query that looks kinda like this
SELECT * FROM table1
WHERE table1.column_1 = 'a' AND table1.column_2 = 'b'
AND :idList IN
(SELECT id FROM table1 WHERE table1.column_3 = 'c' AND table1....
0
votes
3
answers
57
views
How to combine LEFT and LOWER in a multicolumn index for leading text patterns?
I create an index this way:
CREATE INDEX rep_tval_idx ON public.rep USING btree (t, lower(left(val, 127)));
Then I run a SELECT with matching filter:
explain
select * from rep
where t=3 and lower(...
1
vote
0
answers
62
views
How do you index a shorten url?
How do these url shorterner services get their links indexed by google? while mine won't index cause google search consoles says "Page with redirect". I'm just using a simple html page with ...
1
vote
0
answers
160
views
MongoDB total keys examined when multiple documents have the same key value
Consider a collection with an index {x: 1} consisting of the following documents:
[
{x : 5},
{x : 5},
{x : 5}
]
The explain output on the query predicate {x : 5} shows that the total ...
-2
votes
1
answer
77
views
Mysql 5.7 why this sql not using index_merge,it using a full table scan
The home_user table has about 50000 rows, and donate_info table has 100000 rows. I want to calculate every home_user's total donate_count.
I found out Mysql can't use the index in the donate_info ...
13
votes
6
answers
848
views
Identifying data frame rows in R with specific pairs of values in two columns
I would like to identify all rows in a data frame (or matrix) whose values in column 1 and 2 match a specific pair. For example, if I have a matrix
testmat = rbind(c(1,1), c(1,2), c(1,4), c(2,1), c(2,...
0
votes
1
answer
85
views
How can I add and view indexes for a FILETABLE?
I have a SQL Server FILETABLE. I am NOT trying to do FULL TEXT searching. I have a query which uses the file_type column in the WHERE clause. The estimated execution plan suggests a new index. I have ...
0
votes
1
answer
180
views
Change the index access method in PostgreSQL?
I have a bunch of PostgreSQL (v14 or 15) indexes over a few dozen tables that use B-Trees for their access method. We want to change them to hashes as we don't do inequality operations on them, and ...
2
votes
1
answer
184
views
How to Efficiently Manage MongoDB Index Creation in a Go Application?
I'm building a Go application deployed on Kubernetes that uses MongoDB as the database. Currently, my application includes logic to create indexes on collections during every pod startup. While this ...
3
votes
1
answer
144
views
How to extract sub arrays from a larger array with two start and two stop 1-D arrays in Python?
I am looking for a way to vectorize the following code,
# Let cube have shape (N, M, M)
sub_arrays = np.empty(len(cube), 3, 3)
row_start = ... # Shape (N,) and are integers in range [0, M-2]
row_end ...
3
votes
3
answers
136
views
Why mysql uses index with cardinality=1?
I created table categories:
CREATE TABLE `categories` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`type` int unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `type` (`type`)
...
1
vote
1
answer
29
views
Find last occurrence with UNIQUE
There is a vector of numbers:
y = [
2013;
2013;
2013;
2014;
2014;
2015;
2016]
Scilab function unique creates the vector km with indexes of the first occuring unique number in y:
[U, km, ku, nb] = ...
0
votes
2
answers
157
views
How to index a varchar column of unlimited length in Postgres?
I am using a Postgres table to store HTML data. One of the columns is of type varchar, and this is where the HTML data is stored. My understanding is that this column datatype has no maximum length.
I ...
0
votes
2
answers
55
views
Expression Engine Entries Loop Index
Does Expression Engine entries loop have a variable to show which index you're on for each iteration? I found the {count} and {total_results} in the docs, but cant seem to find the variable that spits ...
0
votes
2
answers
133
views
/wp-content pages in Wordpress are being indexed as its own page
I'm getting dozens of unwanted indexed pages in Wordpress that are actually media files URLs like this one:
/wp-content/uploads/2024/11/Ellipse-78
I added a rule in my robots.txt, but I'm not sure it'...
1
vote
1
answer
249
views
Azure ML Vector Index creation in Prompt Flow UI
I´m trying to create an Azure Search vector index as well in the Azure ML UI (Prompt flow) portal but having an error in the component "LLM - Crack and Chunk Data": My Flow Error Image
The ...
-1
votes
1
answer
135
views
Gmod lua mysql attempt to index global "" (a nil value) (DarkRP)
So i wanted to play gmod after some time and when i looked up server was down. They published the files on web and i am trying to make it work. Now i get an error called: attempt to index global '...
0
votes
0
answers
73
views
Creating a dynamic range in excel using a variable starting cell
I am trying to create dynamic ranges to be used for excel charts.
I have the following range:
=OFFSET(O7,0,0,1,COUNTA($O$5:$X$5))
cell o7 is expected to change.
I have created the following formula to ...
2
votes
1
answer
108
views
In MySQL is it redundant to include id as the last field in a composite index?
Knowing id is the primary key...
Lets say we have an index in MySQL like
account_id / assignee_id / is_public
but the sorting of a query that needs this index is by id (the primary index)
changing ...
0
votes
2
answers
105
views
Demystify numpy indexing/slicing
could you please help demystify the following numpy indexing/slicing behaviours? Thanks!
arr = np.arange(60).reshape(3,4,5)
print(arr[2, :, 4]) #1
print(arr[[2], :, 4]) #2
print(arr[2, :, [4]])...
-1
votes
1
answer
92
views
What is the correct strategy for indexing a postgres database for filtering
I want to create indexes in my postgres DB which contains a massive amount of data. The Usecase is to have a frontend, which should be able to filter a few selected fields and in the backend based on ...
1
vote
0
answers
15
views
How to use TextIndexed with subDocument (MongoDB & Java)
I have a document with name User and this document has subDocument with name UserIdentifier like below:
@Data
@Document
public class User {
private List<UserIdentifier> userIdentifierList;
...
1
vote
1
answer
42
views
How to optimize query performance in GridDB for large time-series datasets?
I’m working on a project that involves managing large time-series datasets in GridDB. Currently, I’m experiencing significant query latency issues as the dataset size grows. While GridDB performs well ...
0
votes
3
answers
131
views
Fastest way to find SQL intersection between 2 subsections of a huge dataset?
I have a gigantic indexed (104 million row) table of docs, pages and words:
CREATE TABLE my_table (
doc_id integer,
page_id integer,
word_id integer
);
CREATE INDEX my_table_word ON ...
0
votes
0
answers
72
views
Organizing Content within an AI Search Index
I have thousands of text based content pages. I want to index them organized into categories within Microsoft's AI search Indexes. Any reccommendations/best practices?
I am thinking adding metatags ...
1
vote
1
answer
85
views
Taking values from numpy array using array of indices
I am trying to find a simple numpy command to take the values of an 3D matrix according to an index array for the second coordinate. This can be done as:
import numpy as np
entry = np.array([[1, 2],[3,...
1
vote
1
answer
85
views
How does MySQL handle SELECT queries on partitioned tables?
When querying a non-partitioned table, the query optimizer can leverage indexes for sorting and limit the data read based on the LIMIT clause. For example, in a non-partitioned table my_table with a ...
-1
votes
1
answer
106
views
MySQL B-Tree Index on a Numeric Value in a VARCHAR Column - Inefficiency Concerns
im working with a MySQL database where I have a column of type VARCHAR, but it stores numeric values. I created a B-Tree index on this column to optimize queries like:
E.x > n
n < E.x
n = E.x
(...
0
votes
0
answers
83
views
How to get a MongoDB query to use indexes in a join?
I am trying to learn how to use MongoDB and have two collections that I am trying to join and find records with search criteria in each. In the main collection I have an index on the text field (...
1
vote
1
answer
89
views
GIN index not being used with NOT?
I have a table with a column itemsIds containing an array of ids. I have created a gin index for that column. I'm trying to find rows that don't contain an element with the following query:
select * ...
0
votes
1
answer
42
views
PostgreSQL multi-column index including text and text array columns
I have a table containing email data.
The from column is text (character varying).
The to column and the cc column are both arrays of text (also character varying).
These will be searched using entire ...
1
vote
0
answers
42
views
Do Postgres timestamp indexes work with greater than or less than operators? [duplicate]
I have a Postgres table with an 'at' timestamp column:
CREATE TABLE IF NOT EXISTS public."Impressions"
(
_id character varying COLLATE pg_catalog."default" NOT NULL,
at ...
3
votes
0
answers
500
views
Elastic how to properly reindex a data stream, and keep the data stream name?
I am new to Elastic so I am not very experienced with reindexing data streams.
I need to reindex a specific index in a data stream. I do not want to have to create a new data stream and use that data ...
0
votes
1
answer
40
views
How to create a composite index ASC and DESC on EntityTypeConfiguration
I have a composite index in SQL Server:
CREATE INDEX IX_PetServiceId_Rate
ON PetCenterService (PetServiceId ASC, Rate DESC)
But my project is database-first so I try to config that composite index ...
2
votes
2
answers
85
views
Why does the %in% operator not behave analogously to the == operator with data frame indexing
I'm writing a function to clean some CEX data (doesn't really matter), and I cannot figure out why I am unable to use %in% to subset a data frame with a list when I am able to perform the analogous ...
0
votes
0
answers
41
views
PostgreSQL full text search stops returning results
I created a GIN index on a table in PostgreSQL database. It was created without issue, see below create index statement. Then I used a select query to search the table, also see below.
create index ...
0
votes
0
answers
63
views
Folder Size is too Large of Lucene Documents
I am using the following code to add documents to a Lucene index. I have indexed 23,425 documents, but the folder where the index is stored has a size of 447.4 MB. In contrast, when storing the same ...
1
vote
1
answer
133
views
Does ArcadeDB support indexing collections?
I am doing a hands-off evaluation of Graph Databases and came across ArcadeDB.
I scoured the documentation but did not find explicit mention of which of the supported types can also be indexed, I am ...
0
votes
1
answer
78
views
Why does Postgres not use the index when the comparison value is derived from my function?
There is a table:
create table individual_profile_identity
(
normalized_document_number varchar,
normalized_name varchar,
birth_date date
);
There is an index ...
1
vote
2
answers
79
views
Mongo db unique index on sub document problem
I have a collection estates with a unique index on the name field, created thus:
db.estates.createIndex ({ "name": 1 }, { unique: true })
This works - attempts to insert a duplicate name ...
1
vote
1
answer
74
views
how to optimize SQL query with multiple JSONB contains conditions?
i am working on a PostgreSQL database where i need to filter rows based on multiple conditions in a JSONB column. the column attributes stores data like this
{
"color": "red",
&...
0
votes
1
answer
47
views
SQL Server 2017 not using index
I have a table and a (non-pk) index
CREATE TABLE [UniqueIdentifier]
(
[Id] [varchar](100) NOT NULL,
[ShortUI] [varchar](50) NULL,
[StateId] [tinyint] NOT NULL,
[TypeId] [tinyint] NOT ...
0
votes
1
answer
201
views
ClickHouse data skipping index seemingly not skipping any rows
I have a simple table in ClickHouse with 10M rows, defined like this:
CREATE TABLE data.syslogs
(
`id` UInt32,
`time` DateTime,
`priority` UInt8,
`message` String,
INDEX ...
1
vote
1
answer
292
views
Cassandra SAI (Storage Attached Indexes) on Cassandra 5, Free Version
We want to utilize SAI on Cassandra Free version. To enhance search capabilities, we have gone through Apache Solr => Apache Startio => Cassandra Lucene Index. But these are not maintained, ...
1
vote
1
answer
35
views
Assigning column from different data frame - role of index
import pandas as pd
df_1 = pd.DataFrame({'col1': ['a', 'a', 'a']})
df_2 = pd.DataFrame({'col1': ['b', 'b', 'b']})
df_2.index = [4,5,6]
df_1['col2'] = df_2.col1
I expect a simple copy in the above ...
1
vote
2
answers
111
views
Converting an array of floats into RGBA values in an efficient way
I am trying to create a system to take an array of floats which range from 0.0 to 1.0 and convert them into RGBA values based on a lookup table. The output should be an array that is one dimension ...
2
votes
2
answers
209
views
InnoDB deadlock caused by two transactions holding the same exclusive lock
I am running MySql v8.0 with InnoDB. I have a simple transaction that has a SELECT (not a SELECT ... FOR UPDATE) followed by an INSERT. I'm getting frequent deadlocks when many DB inserts are ...