Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 2639

A database structure that can improve the speed of queries at the cost of disk space and slower inserts/updates. It stores a copy of one or more columns sorted but structures the data differently to allow faster access.

2 votes

MySQL 8 not using Spatial Index?

Your query has WHERE ST_Distance_Sphere ( geo_point, ST_GeomFromText ( 'POINT(51.85 -0.79)', 4326 )) <= 100 * 1609.34 ) In MySQL you must use the MBR functions to use the index. …
Evan Carroll's user avatar
  • 64.7k
6 votes
Accepted

Definition of indexing, datatype configuration, and DBMS for SHA3-256 hashes

On indexing, any HASH index would work if your database provides it. … From PostgreSQL, CREATE DOMAIN sha3_256 AS bytea; CREATE TABLE datastore ( id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, myhash sha3_256 ); CREATE INDEX ON datastore USING HASH (myhash …
Evan Carroll's user avatar
  • 64.7k
2 votes

postgres bloom index

Your indexing is totally irrelevant neither index is used (thus the <1% difference). Did you ANALYZE the table after you created the index? … I would expect the bloom index speed things up by massively reducing the size of the table you have to visit. …
Evan Carroll's user avatar
  • 64.7k
5 votes
Accepted

Do BRIN indexes support ENUM types?

In fact that commit explicitly says, +/* no brin opclass for enum, tsvector, tsquery, jsonb, range */ Actually creating a BRIN index for an ENUM is, afaik, going to require some use of C and knowledge … of index operator class implementation (pick/split/insert/merge). …
Evan Carroll's user avatar
  • 64.7k
0 votes

Optimize Postgresql query

DEFAULT AS IDENTITY, parent_people_id int REFERENCES people, first_name text, last_name text, email email NOT NULL, partner_id int ); CREATE INDEX … ON people(parent_people_id); CREATE INDEX ON people(email); See also What is the best way to store an email address in PostgreSQL? …
Evan Carroll's user avatar
  • 64.7k
5 votes

Determining if an IP is within an IPv4 CIDR Block

Easily done, CREATE TABLE ip2loc_asn ( asn bigint, cidr cidr, name text ); CREATE INDEX ON ip2loc_asn USING gist(cidr); INSERT INTO ip2loc_asn(asn,cidr,name) VALUES ( 56203, '1.0.4.0 … TOT Public Company Limited 9737 | 1.0.128.0/18 | TOT Public Company Limited 9737 | 1.0.128.0/19 | TOT Public Company Limited 23969 | 1.0.129.0/24 | TOT Public Company Limited This happens on the index
Evan Carroll's user avatar
  • 64.7k
2 votes

"Create Unique Index" on big table taking too long time

891 Million rows is quite a bit. This is a problem with MyISAM and unique indexes. Bug #22487 mysql performs extremely slow when creating unique indexes on huge table WL#1333: Speed up ALTER TABLE …
Evan Carroll's user avatar
  • 64.7k
17 votes
Accepted

How do you index a text column in MySQL?

In MySQL Key Length is added as a type-modifier and placed in parenthesis colname(), you can provide it to CREATE INDEX like this, CREATE INDEX foo_bar_idx ON foo ( bar(500) ); It's part of index_col_name … CREATE FULLTEXT INDEX foo_bar_ftsidx ON foo ( bar ); For more information see the MySQL docs on Full Text Search …
Evan Carroll's user avatar
  • 64.7k
1 vote
Accepted

Generic way to determine if the table needs index (PostgreSQL)

So you're working at the problem from the wrong angle, the right question isn't Are all of those factors correct to create an index? But instead, For this given query, can I use an index? … That is to say, go ahead and create the index. …
Evan Carroll's user avatar
  • 64.7k
1 vote

Spatial Index on an InnoDB table

MySQL 5.7+ In MySQL 5.7, InnoDB got Spatial Indexes, from What Is New in MySQL 5.7 InnoDB now supports MySQL-supported spatial data types. Prior to this release, InnoDB would store spatial data a …
Evan Carroll's user avatar
  • 64.7k
18 votes
Accepted

Does PostgreSQL index null values?

Since at least PostgreSQL 8.3, PostgreSQL indexes NULL using a bitmap on the index. That means "yes" it's indexed. Except it takes a bit, rather than a byte[s]. …
Evan Carroll's user avatar
  • 64.7k
1 vote

Can spatial index help a "range - order by - limit" query

Using a GIST index Is there a way to make it perform fast, regardless of whether the range (@Low, @High) is wide or narrow and regardless of whether the top frequency words are luckily in the (narrow … This is simply because our selectivity estimates let pg conclude heap access is faster than scanning an index and rechecking. …
Evan Carroll's user avatar
  • 64.7k
9 votes

Does Postgres offer a feature like “NEWSEQUENTIALID” in MS SQL Server to make UUID as primar...

That all said, I agree with @a_horse_with_no_name, From my understanding this is only necessary in SQL Server because tables are stored in a clustered index which makes random insertions slower then with …
Evan Carroll's user avatar
  • 64.7k
4 votes

Does mysql use B-tree,B+tree or both?

A B+Tree is a just a binary search tree, like a B-Tree, where, The leaves (buckets) have links to the right and left siblings buckets), making the tree an index into a linked list. … It's unlikely that any database that implements a B+Tree would use B-Tree, unless they're only ever interested in Index Seeks, and not Index Scans. The overhead of the link isn't substantial. …
Evan Carroll's user avatar
  • 64.7k
3 votes

What is a "Loose Index Scan"?

From High Performance MySQL Third Edition, Loose Index Scans MySQL has historically been unable to do loose index scans, which scan noncontiguous ranges of an index. … It (most RDBMS) can use an index, but without an implementation of a loose index scan they would have had to scan the entire index, as in an Index-only scan. This saves having to visit the table. …
Evan Carroll's user avatar
  • 64.7k

1
2 3 4 5
15 30 50 per page