SlideShare une entreprise Scribd logo
1  sur  54
Télécharger pour lire hors ligne
Полнотекстовый поиск в PostgreSQL
        за миллисекунды
          Олег Бартунов
        Александр Коротков
Full-text search in DB
●   Full-text search
     – Find documents, which satisfy query
     – return results in some order (opt.)
●   Requirements to FTS
     – Full integration with DB core

         ●   transaction support
         ●   concurrency and recovery
         ●   online index
    –   Linguistic support
    –   Flexibility, Scalability
What is a document ?

●   Arbitrary textual attribute
●   Combination of textual attributes
●   Could be fully virtual
●   It's a textual result of any SQL, for example –
    join of doc and authors tables

       Title || Abstract || Keywords || Body || Author
Text Search Operators
 ●   Traditional FTS operators for textual attributes
      ~, ~*, LIKE, ILIKE
 Problems
– No linguistic support, no stop-words
– No ranking
– Sequential scan all documents, slow
  Solution
– Preprocess document in advance
– Add index support
FTS in PostgreSQL
●   set of rules how document and query should
    be transformed to their FTS representations –
    tsvector, tsquery
●   set of functions to obtain tsvector, tsquery
    from textual data types
●   FTS operators and indexes
●   ranking functions, headline
FTS in PostgreSQL
=# select 'a fat cat sat on a mat and ate a fat rat'::tsvector
                           @@
                   'cat & rat':: tsquery;
 – tsvector – storage for document, optimized for search
    • sorted array of lexemes
    • positional information
    • weights information
 – tsquery – textual data type for query
        • Boolean operators - & | ! ()
 – FTS operator
      tsvector @@ tsquery
FTS features
●   Full integration with PostgreSQL
●   27 built-in configurations for 10 languages
●   Support of user-defined FTS configurations
●   Pluggable dictionaries ( ispell, snowball, thesaurus ),
    parsers
●   Relevance ranking
●   GiST and GIN indexes with concurrency and recovery
    support
●   Rich query language with query rewriting support
FTS in PostgreSQL

● OpenFTS — 2000, Pg as a storage
● GiST index — 2000, thanks Rambler

● Tsearch — 2001, contrib:no ranking

● Tsearch2 — 2003, contrib:config

● GIN —2006, thanks, JFG Networks

● FTS — 2006, in-core, thanks,EnterpriseDB

● E-FTS — Enterprise FTS, thanks ???
ACID overhead is really big :(
●   Foreign solutions: Sphinx, Solr, Lucene....
    –   Crawl database and index (time lag)
    –   No access to attributes
    –   Additional complexity
    –   BUT: Very fast !
●   Can we improve native FTS ?
Can we improve native FTS ?
1.Find relevant documents
  1. Index scan — usually very fast

2.Calculate ranks for all founded documents
  1. Heap scan — usually slow

3.Sort documents
Can we improve native FTS ?
156676 Wikipedia articles:

postgres=# explain analyze
SELECT docid, ts_rank(text_vector, to_tsquery('english', 'title')) AS rank
FROM ti2
WHERE text_vector @@ to_tsquery('english', 'title')
ORDER BY rank DESC
LIMIT 3;

Limit (cost=8087.40..8087.41 rows=3 width=282) (actual time=433.750..433.752 rows=
  -> Sort (cost=8087.40..8206.63 rows=47692 width=282) (actual time=433.749..433
        Sort Key: (ts_rank(text_vector, '''titl'''::tsquery))
        Sort Method: top-N heapsort Memory: 25kB
        -> Bitmap Heap Scan on ti2 (cost=529.61..7470.99 rows=47692 width=282) (
              Recheck Cond: (text_vector @@ '''titl'''::tsquery)
              -> Bitmap Index Scan on ti2_index (cost=0.00..517.69 rows=47692 wi
                    Index Cond: (text_vector @@ '''titl'''::tsquery)
Total runtime: 433.787 ms
Скорости нннада?
Can we improve native FTS ?
156676 Wikipedia articles:

postgres=# explain analyze
SELECT docid, ts_rank(text_vector, to_tsquery('english', 'title')) AS rank
FROM ti2
WHERE text_vector @@ to_tsquery('english', 'title')
ORDER BY text_vector>< plainto_tsquery('english','title')
LIMIT 3;

What if we have this plan ?
Limit  (cost=20.00..21.65 rows=3 width=282) (actual time=18.376..18.427 rows=3 loop
   ->  Index Scan using ti2_index on ti2 (cost=20.00..26256.30 rows=47692 width=28
         Index Cond: (text_vector @@ '''titl'''::tsquery)
         Order By: (text_vector >< '''titl'''::tsquery)
 Total runtime: 18.511 ms


                       We'll be FINE !
We'll be FINE !



● Teach index (GIN) to calculate ranks and
returns results in sorted order
   ● Store positions in index — no need for

     tsvector column, use compression to
     keep index small
   ● Change algorithms and interfaces
We'll be FINE !

●   Additional benefit
    –   T(rare_word & frequent_word) ~ T(rare_word)
Inverted Index
Inverted Index



QUERY: compensation accelerometers

INDEX: accelerometers                     compensation
        5,10,25,28,30,36,58,59,61,73,74
                   30                     30,68
                                          30
 RESULT: 30
No positions in index !

    Inverted Index in PostgreSQL

E
N
T            Posting list
R            Posting tree

Y

T
R
E
E
Summary of changes
• GIN
  – storage
  – search
  – ORDER BY
  – interface
• planner
GIN structure changes
Add additional information
     (word positions)
ItemPointer
typedef struct ItemPointerData
{
  BlockIdData ip_blkid;
  OffsetNumber ip_posid;
}
                                 6 bytes
typedef struct BlockIdData
{
  uint16    bi_hi;
  uint16    bi_lo;
} BlockIdData;
WordEntryPos
/*
 * Equivalent to
 * typedef struct {
 *   uint16
 *     weight:2,
 *     pos:14;
                               2 bytes
 * }
 */

typedef uint16 WordEntryPos;
BlockIdData compression
OffsetNumber compression




O0-O15 – OffsetNumber bits
N – Additional information NULL bit
WordEntryPos compression




P0-P13 – position bits
W0,W1 – weight bits
Example
GIN algorithm changes
Top-N queries

1. Scan + calc rank
2. Sort
3. Return using gingettuple one by one
Fast scan

entry1 && entry2
GIN interface changes
extractValue

Datum *extractValue
(
  Datum itemValue,
  int32 *nkeys,
  bool **nullFlags,
  Datum *addInfo,
  bool *addInfoIsNull
)
extractQuery
Datum *extractValue
(
  Datum query,
  int32 *nkeys,
  StrategyNumber n,
  bool **pmatch,
  Pointer **extra_data,
  bool **nullFlags,
  int32 *searchMode,
  ???bool **required???
)
consistent
bool consistent
(
   bool check[],
   StrategyNumber n,
   Datum query,
   int32 nkeys,
   Pointer extra_data[],
   bool *recheck,
   Datum queryKeys[],
   bool nullFlags[],
   Datum addInfo[],
   bool addInfoIsNull[]
)
calcRank
float8 calcRank
(
   bool check[],
   StrategyNumber n,
   Datum query,
   int32 nkeys,
   Pointer extra_data[],
   bool *recheck,
   Datum queryKeys[],
   bool nullFlags[],
   Datum addInfo[],
   bool addInfoIsNull[]
)
???joinAddInfo???


Datum joinAddInfo
(
  Datum addInfos[]
)
Planner optimization
Before
test=# EXPLAIN (ANALYZE, VERBOSE) SELECT * FROM test ORDER BY slow_func(x,y)
LIMIT 10;
                               QUERY PLAN

-------------------------------------------------------------------------------------------------------------------
 Limit (cost=0.00..3.09 rows=10 width=16) (actual time=11.344..103.443 rows=10
loops=1)
  Output: x, y, (slow_func(x, y))
  -> Index Scan using test_idx on public.test (cost=0.00..309.25 rows=1000 width=16)
(actual time=11.341..103.422 rows=10 loops=1)
       Output: x, y, slow_func(x, y)
 Total runtime: 103.524 ms
(5 rows)
After
test=# EXPLAIN (ANALYZE, VERBOSE) SELECT * FROM test ORDER BY slow_func(x,y)
LIMIT 10;
                              QUERY PLAN

-------------------------------------------------------------------------------------------------------------------
 Limit (cost=0.00..3.09 rows=10 width=16) (actual time=0.062..0.093 rows=10 loops=1)
  Output: x, y
  -> Index Scan using test_idx on public.test (cost=0.00..309.25 rows=1000 width=16)
(actual time=0.058..0.085 rows=10 loops=1)
       Output: x, y
 Total runtime: 0.164 ms
(5 rows)
Testing results
avito.ru: 6.7 mln. docs
With tsvector column
SELECT
     itemid, title
FROM
     items
WHERE
     fts @@ plainto_tsquery('russian', 'угловой
шкаф')
ORDER BY
     ts_rank(fts, plainto_tsquery('russian',
'угловой шкаф')) DESC
LIMIT
     10;
With tsvector column without patch,
Limit (cost=2341.92..2341.94 rows=10 width=398) (actual time=38.532..38.5
   Buffers: shared hit=12830
   -> Sort (cost=2341.92..2343.37 rows=581 width=398) (actual time=38.53
         Sort Key: (ts_rank(fts, '''углов'' & ''шкаф'''::tsquery))
         Sort Method: top-N heapsort Memory: 26kB
         Buffers: shared hit=12830
         -> Bitmap Heap Scan on items (cost=48.50..2329.36 rows=581 widt
               Recheck Cond: (fts @@ '''углов'' & ''шкаф'''::tsquery)
               Buffers: shared hit=12830
               -> Bitmap Index Scan on fts_idx (cost=0.00..48.36 rows=58
                     Index Cond: (fts @@ '''углов'' & ''шкаф'''::tsquery)
                     Buffers: shared hit=116
 Total runtime: 38.569 ms
With tsvector column with patch,


 Limit (cost=40.00..80.28 rows=10 width=400) (actual
time=11.528..11.536
   Buffers: shared hit=374
   -> Index Scan using fts_idx on items
(cost=40.00..2863.77 rows=701
       Index Cond: (fts @@ '''углов'' & ''шкаф'''::tsquery)
         Order By: (fts >< '''углов'' & ''шкаф'''::tsquery)
         Buffers: shared hit=374
 Total runtime: 11.561 ms
Without tsvector column
SELECT itemid, title
FROM items2
WHERE (setweight(to_tsvector('russian'::regconfig,
title), 'A'::"char") ||
setweight(to_tsvector( 'russian'::regconfig,
description), 'B'::"char")) @@
plainto_tsquery('russian', 'угловой шкаф')
ORDER BY
ts_rank((setweight(to_tsvector('russian'::regconfig,
title), 'A'::"char") ||
setweight(to_tsvector('russian'::regconfig,
description), 'B'::"char")), plainto_tsquery('russian',
'угловой шкаф')) DESC
LIMIT 10;
Without tsvector column, without patch

Limit (cost=2596.31..2596.33 rows=10 width=372) (actual time=862.520..86
  Buffers: shared hit=6875
  -> Sort (cost=2596.31..2597.91 rows=642 width=372) (actual time=862.5
        Sort Key: (ts_rank((setweight(to_tsvector('russian'::regconfig,
        Sort Method: top-N heapsort Memory: 26kB
        Buffers: shared hit=6875
        -> Bitmap Heap Scan on items2 (cost=48.98..2582.44 rows=642 wid
              Recheck Cond: ((setweight(to_tsvector('russian'::regconfig,
              Buffers: shared hit=6875
              -> Bitmap Index Scan on fts_idx2 (cost=0.00..48.82 rows=6

                  Index Cond: ((setweight(to_tsvector('russian'::regconfi
                  Buffers: shared hit=116
Total runtime: 862.551 ms
Without tsvector column, with patch


 Limit (cost=40.02..80.43 rows=10 width=373) (actual
time=11.298..11.304
   Buffers: shared hit=374
   -> Index Scan using fts_idx2 on items2
(cost=40.02..2771.68 rows=676
       Index Cond:
((setweight(to_tsvector('russian'::regconfig, title),
         Order By:
((setweight(to_tsvector('russian'::regconfig, title),
         Buffers: shared hit=374
 Total runtime: 11.321 ms
avito.ru: tests
               Without With patch With patch      Sphinx
                patch              without
                                   tsvector
Table size      6.0 GB      6.0 GB     2.87 GB             -

Index size     1.29 GB     1.27 GB     1.27 GB     1.12 GB
Index build    216 sec     303 sec      718sec    180 sec*
time
Queries in 8   3,0 mln.   42.7 mln.   42.7 mln.   32.0 mln.
hours
Anonymous source: 18 mln. docs
Anonymous source: tests
               Without      With       With patch   Sphinx
                patch       patch       without
                                        tsvector
Table size      18.2 GB     18.2 GB       11.9 GB            -

Index size      2.28 GB     2.30 GB       2.30 GB    3.09 GB
Index build     258 sec     684 sec      1712 sec   481 sec*
time
Queries in 8   2.67 mln.   38.7 mln.    38.7 mln.   26.7 mln.
hours
Пуляет!!!
Status & Availability


• 150 Kb patch for 9.3
• Datasets and workloads are welcome
Plans & TODO
• Fix recovery
• Fix fastupdate
• Fast scan interface
• Accelerate index build if possible
• Partial match support
Thanks!
Sponsors are welcome!

Contenu connexe

Tendances

What is the best full text search engine for Python?
What is the best full text search engine for Python?What is the best full text search engine for Python?
What is the best full text search engine for Python?Andrii Soldatenko
 
Rank Your Results with PostgreSQL Full Text Search (from PGConf2015)
Rank Your Results with PostgreSQL Full Text Search (from PGConf2015)Rank Your Results with PostgreSQL Full Text Search (from PGConf2015)
Rank Your Results with PostgreSQL Full Text Search (from PGConf2015)Jamey Hanson
 
Going beyond Django ORM limitations with Postgres
Going beyond Django ORM limitations with PostgresGoing beyond Django ORM limitations with Postgres
Going beyond Django ORM limitations with PostgresCraig Kerstiens
 
Non-Relational Postgres / Bruce Momjian (EnterpriseDB)
Non-Relational Postgres / Bruce Momjian (EnterpriseDB)Non-Relational Postgres / Bruce Momjian (EnterpriseDB)
Non-Relational Postgres / Bruce Momjian (EnterpriseDB)Ontico
 
Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL AdministrationEDB
 
On Beyond (PostgreSQL) Data Types
On Beyond (PostgreSQL) Data TypesOn Beyond (PostgreSQL) Data Types
On Beyond (PostgreSQL) Data TypesJonathan Katz
 
PyCon Russian 2015 - Dive into full text search with python.
PyCon Russian 2015 - Dive into full text search with python.PyCon Russian 2015 - Dive into full text search with python.
PyCon Russian 2015 - Dive into full text search with python.Andrii Soldatenko
 
JDD 2016 - Tomasz Borek - DB for next project? Why, Postgres, of course
JDD 2016 - Tomasz Borek - DB for next project? Why, Postgres, of course JDD 2016 - Tomasz Borek - DB for next project? Why, Postgres, of course
JDD 2016 - Tomasz Borek - DB for next project? Why, Postgres, of course PROIDEA
 
John Melesky - Federating Queries Using Postgres FDW @ Postgres Open
John Melesky - Federating Queries Using Postgres FDW @ Postgres OpenJohn Melesky - Federating Queries Using Postgres FDW @ Postgres Open
John Melesky - Federating Queries Using Postgres FDW @ Postgres OpenPostgresOpen
 
PostgreSQL 9.4, 9.5 and Beyond @ COSCUP 2015 Taipei
PostgreSQL 9.4, 9.5 and Beyond @ COSCUP 2015 TaipeiPostgreSQL 9.4, 9.5 and Beyond @ COSCUP 2015 Taipei
PostgreSQL 9.4, 9.5 and Beyond @ COSCUP 2015 TaipeiSatoshi Nagayasu
 
PostgreSQL FTS Solutions FOSDEM 2013 - PGDAY
PostgreSQL FTS Solutions FOSDEM 2013 - PGDAYPostgreSQL FTS Solutions FOSDEM 2013 - PGDAY
PostgreSQL FTS Solutions FOSDEM 2013 - PGDAYEmanuel Calvo
 
InfluxDB IOx Tech Talks: Intro to the InfluxDB IOx Read Buffer - A Read-Optim...
InfluxDB IOx Tech Talks: Intro to the InfluxDB IOx Read Buffer - A Read-Optim...InfluxDB IOx Tech Talks: Intro to the InfluxDB IOx Read Buffer - A Read-Optim...
InfluxDB IOx Tech Talks: Intro to the InfluxDB IOx Read Buffer - A Read-Optim...InfluxData
 
Cassandra summit 2013 - DataStax Java Driver Unleashed!
Cassandra summit 2013 - DataStax Java Driver Unleashed!Cassandra summit 2013 - DataStax Java Driver Unleashed!
Cassandra summit 2013 - DataStax Java Driver Unleashed!Michaël Figuière
 
Flexible Indexing with Postgres
Flexible Indexing with PostgresFlexible Indexing with Postgres
Flexible Indexing with PostgresEDB
 
2015-12-05 Александр Коротков, Иван Панченко - Слабо-структурированные данные...
2015-12-05 Александр Коротков, Иван Панченко - Слабо-структурированные данные...2015-12-05 Александр Коротков, Иван Панченко - Слабо-структурированные данные...
2015-12-05 Александр Коротков, Иван Панченко - Слабо-структурированные данные...HappyDev
 
You know, for search. Querying 24 Billion Documents in 900ms
You know, for search. Querying 24 Billion Documents in 900msYou know, for search. Querying 24 Billion Documents in 900ms
You know, for search. Querying 24 Billion Documents in 900msJodok Batlogg
 
C*ollege Credit: Creating Your First App in Java with Cassandra
C*ollege Credit: Creating Your First App in Java with CassandraC*ollege Credit: Creating Your First App in Java with Cassandra
C*ollege Credit: Creating Your First App in Java with CassandraDataStax
 

Tendances (20)

What is the best full text search engine for Python?
What is the best full text search engine for Python?What is the best full text search engine for Python?
What is the best full text search engine for Python?
 
Rank Your Results with PostgreSQL Full Text Search (from PGConf2015)
Rank Your Results with PostgreSQL Full Text Search (from PGConf2015)Rank Your Results with PostgreSQL Full Text Search (from PGConf2015)
Rank Your Results with PostgreSQL Full Text Search (from PGConf2015)
 
Going beyond Django ORM limitations with Postgres
Going beyond Django ORM limitations with PostgresGoing beyond Django ORM limitations with Postgres
Going beyond Django ORM limitations with Postgres
 
Non-Relational Postgres / Bruce Momjian (EnterpriseDB)
Non-Relational Postgres / Bruce Momjian (EnterpriseDB)Non-Relational Postgres / Bruce Momjian (EnterpriseDB)
Non-Relational Postgres / Bruce Momjian (EnterpriseDB)
 
Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL Administration
 
On Beyond (PostgreSQL) Data Types
On Beyond (PostgreSQL) Data TypesOn Beyond (PostgreSQL) Data Types
On Beyond (PostgreSQL) Data Types
 
PyCon Russian 2015 - Dive into full text search with python.
PyCon Russian 2015 - Dive into full text search with python.PyCon Russian 2015 - Dive into full text search with python.
PyCon Russian 2015 - Dive into full text search with python.
 
JDD 2016 - Tomasz Borek - DB for next project? Why, Postgres, of course
JDD 2016 - Tomasz Borek - DB for next project? Why, Postgres, of course JDD 2016 - Tomasz Borek - DB for next project? Why, Postgres, of course
JDD 2016 - Tomasz Borek - DB for next project? Why, Postgres, of course
 
John Melesky - Federating Queries Using Postgres FDW @ Postgres Open
John Melesky - Federating Queries Using Postgres FDW @ Postgres OpenJohn Melesky - Federating Queries Using Postgres FDW @ Postgres Open
John Melesky - Federating Queries Using Postgres FDW @ Postgres Open
 
Pgbr 2013 fts
Pgbr 2013 ftsPgbr 2013 fts
Pgbr 2013 fts
 
PostgreSQL 9.4, 9.5 and Beyond @ COSCUP 2015 Taipei
PostgreSQL 9.4, 9.5 and Beyond @ COSCUP 2015 TaipeiPostgreSQL 9.4, 9.5 and Beyond @ COSCUP 2015 Taipei
PostgreSQL 9.4, 9.5 and Beyond @ COSCUP 2015 Taipei
 
PostgreSQL
PostgreSQLPostgreSQL
PostgreSQL
 
PostgreSQL FTS Solutions FOSDEM 2013 - PGDAY
PostgreSQL FTS Solutions FOSDEM 2013 - PGDAYPostgreSQL FTS Solutions FOSDEM 2013 - PGDAY
PostgreSQL FTS Solutions FOSDEM 2013 - PGDAY
 
InfluxDB IOx Tech Talks: Intro to the InfluxDB IOx Read Buffer - A Read-Optim...
InfluxDB IOx Tech Talks: Intro to the InfluxDB IOx Read Buffer - A Read-Optim...InfluxDB IOx Tech Talks: Intro to the InfluxDB IOx Read Buffer - A Read-Optim...
InfluxDB IOx Tech Talks: Intro to the InfluxDB IOx Read Buffer - A Read-Optim...
 
Cassandra summit 2013 - DataStax Java Driver Unleashed!
Cassandra summit 2013 - DataStax Java Driver Unleashed!Cassandra summit 2013 - DataStax Java Driver Unleashed!
Cassandra summit 2013 - DataStax Java Driver Unleashed!
 
MongoDB-SESSION03
MongoDB-SESSION03MongoDB-SESSION03
MongoDB-SESSION03
 
Flexible Indexing with Postgres
Flexible Indexing with PostgresFlexible Indexing with Postgres
Flexible Indexing with Postgres
 
2015-12-05 Александр Коротков, Иван Панченко - Слабо-структурированные данные...
2015-12-05 Александр Коротков, Иван Панченко - Слабо-структурированные данные...2015-12-05 Александр Коротков, Иван Панченко - Слабо-структурированные данные...
2015-12-05 Александр Коротков, Иван Панченко - Слабо-структурированные данные...
 
You know, for search. Querying 24 Billion Documents in 900ms
You know, for search. Querying 24 Billion Documents in 900msYou know, for search. Querying 24 Billion Documents in 900ms
You know, for search. Querying 24 Billion Documents in 900ms
 
C*ollege Credit: Creating Your First App in Java with Cassandra
C*ollege Credit: Creating Your First App in Java with CassandraC*ollege Credit: Creating Your First App in Java with Cassandra
C*ollege Credit: Creating Your First App in Java with Cassandra
 

En vedette

Сравнительный анализ хранилищ данных, Олег Царев, Кирилл Коринский
Сравнительный анализ хранилищ данных, Олег Царев, Кирилл КоринскийСравнительный анализ хранилищ данных, Олег Царев, Кирилл Коринский
Сравнительный анализ хранилищ данных, Олег Царев, Кирилл КоринскийFuenteovejuna
 
Краткий обзор новинок PostgreSQL 9.4 – Николай Самохвалов
Краткий обзор новинок PostgreSQL 9.4 – Николай СамохваловКраткий обзор новинок PostgreSQL 9.4 – Николай Самохвалов
Краткий обзор новинок PostgreSQL 9.4 – Николай СамохваловYandex
 
Синие против красных
Синие против красныхСиние против красных
Синие против красныхSergey Melekhin
 
~20081006 Highload2008 Postgresql самохвалов
~20081006 Highload2008 Postgresql самохвалов~20081006 Highload2008 Postgresql самохвалов
~20081006 Highload2008 Postgresql самохваловOntico
 
Тюним память и сетевой стек в Linux: история перевода высоконагруженных серве...
Тюним память и сетевой стек в Linux: история перевода высоконагруженных серве...Тюним память и сетевой стек в Linux: история перевода высоконагруженных серве...
Тюним память и сетевой стек в Linux: история перевода высоконагруженных серве...Ontico
 
2014.09.24 история небольшого успеха с PostgreSQL (Yandex)
2014.09.24 история небольшого успеха с PostgreSQL (Yandex)2014.09.24 история небольшого успеха с PostgreSQL (Yandex)
2014.09.24 история небольшого успеха с PostgreSQL (Yandex)Nikolay Samokhvalov
 
PostgreSQL. Стильно. Модно. Молодёжно
PostgreSQL. Стильно. Модно. МолодёжноPostgreSQL. Стильно. Модно. Молодёжно
PostgreSQL. Стильно. Модно. МолодёжноVladislav Bezverhiy
 
PostgreSQL Moscow Meetup - September 2014 - Nikolay Samokhvalov
PostgreSQL Moscow Meetup - September 2014 - Nikolay SamokhvalovPostgreSQL Moscow Meetup - September 2014 - Nikolay Samokhvalov
PostgreSQL Moscow Meetup - September 2014 - Nikolay SamokhvalovNikolay Samokhvalov
 
PG Day'14 Russia, PostgreSQL в avito.ru, Михаил Тюрин
PG Day'14 Russia, PostgreSQL в avito.ru, Михаил ТюринPG Day'14 Russia, PostgreSQL в avito.ru, Михаил Тюрин
PG Day'14 Russia, PostgreSQL в avito.ru, Михаил Тюринpgdayrussia
 
Что такое Postgresql (Максим Богук)
Что такое Postgresql (Максим Богук)Что такое Postgresql (Максим Богук)
Что такое Postgresql (Максим Богук)Ontico
 
Павел Лузанов, Postgres Professional. «PostgreSQL для пользователей Oracle»
Павел Лузанов, Postgres Professional. «PostgreSQL для пользователей Oracle»Павел Лузанов, Postgres Professional. «PostgreSQL для пользователей Oracle»
Павел Лузанов, Postgres Professional. «PostgreSQL для пользователей Oracle»Mail.ru Group
 
Владимир Бородин - PostgreSQL
Владимир Бородин - PostgreSQLВладимир Бородин - PostgreSQL
Владимир Бородин - PostgreSQLYandex
 
Postgres Presentation
Postgres PresentationPostgres Presentation
Postgres Presentationgisborne
 
Spilo, отказоустойчивый PostgreSQL кластер / Oleksii Kliukin (Zalando SE)
Spilo, отказоустойчивый PostgreSQL кластер / Oleksii Kliukin (Zalando SE)Spilo, отказоустойчивый PostgreSQL кластер / Oleksii Kliukin (Zalando SE)
Spilo, отказоустойчивый PostgreSQL кластер / Oleksii Kliukin (Zalando SE)Ontico
 
Борис Верюгин, Диасофт Платформа. «Автоматизированные механизмы миграции прил...
Борис Верюгин, Диасофт Платформа. «Автоматизированные механизмы миграции прил...Борис Верюгин, Диасофт Платформа. «Автоматизированные механизмы миграции прил...
Борис Верюгин, Диасофт Платформа. «Автоматизированные механизмы миграции прил...Mail.ru Group
 
Benchmarking PostgreSQL in Linux and FreeBSD
Benchmarking PostgreSQL in Linux and FreeBSDBenchmarking PostgreSQL in Linux and FreeBSD
Benchmarking PostgreSQL in Linux and FreeBSDAlex Chistyakov
 
Андрей Кондрашов, Банк Москвы. «АБС в крупном Банке. Тестирование PostgreSQL...
Андрей Кондрашов, Банк Москвы.  «АБС в крупном Банке. Тестирование PostgreSQL...Андрей Кондрашов, Банк Москвы.  «АБС в крупном Банке. Тестирование PostgreSQL...
Андрей Кондрашов, Банк Москвы. «АБС в крупном Банке. Тестирование PostgreSQL...Mail.ru Group
 
Девять кругов ада или PostgreSQL Vacuum / Алексей Лесовский (PostgreSQL-Consu...
Девять кругов ада или PostgreSQL Vacuum / Алексей Лесовский (PostgreSQL-Consu...Девять кругов ада или PostgreSQL Vacuum / Алексей Лесовский (PostgreSQL-Consu...
Девять кругов ада или PostgreSQL Vacuum / Алексей Лесовский (PostgreSQL-Consu...Ontico
 

En vedette (20)

Сравнительный анализ хранилищ данных, Олег Царев, Кирилл Коринский
Сравнительный анализ хранилищ данных, Олег Царев, Кирилл КоринскийСравнительный анализ хранилищ данных, Олег Царев, Кирилл Коринский
Сравнительный анализ хранилищ данных, Олег Царев, Кирилл Коринский
 
Краткий обзор новинок PostgreSQL 9.4 – Николай Самохвалов
Краткий обзор новинок PostgreSQL 9.4 – Николай СамохваловКраткий обзор новинок PostgreSQL 9.4 – Николай Самохвалов
Краткий обзор новинок PostgreSQL 9.4 – Николай Самохвалов
 
Синие против красных
Синие против красныхСиние против красных
Синие против красных
 
~20081006 Highload2008 Postgresql самохвалов
~20081006 Highload2008 Postgresql самохвалов~20081006 Highload2008 Postgresql самохвалов
~20081006 Highload2008 Postgresql самохвалов
 
Тюним память и сетевой стек в Linux: история перевода высоконагруженных серве...
Тюним память и сетевой стек в Linux: история перевода высоконагруженных серве...Тюним память и сетевой стек в Linux: история перевода высоконагруженных серве...
Тюним память и сетевой стек в Linux: история перевода высоконагруженных серве...
 
2014.09.24 история небольшого успеха с PostgreSQL (Yandex)
2014.09.24 история небольшого успеха с PostgreSQL (Yandex)2014.09.24 история небольшого успеха с PostgreSQL (Yandex)
2014.09.24 история небольшого успеха с PostgreSQL (Yandex)
 
PostgreSQL. Стильно. Модно. Молодёжно
PostgreSQL. Стильно. Модно. МолодёжноPostgreSQL. Стильно. Модно. Молодёжно
PostgreSQL. Стильно. Модно. Молодёжно
 
PostgreSQL Moscow Meetup - September 2014 - Nikolay Samokhvalov
PostgreSQL Moscow Meetup - September 2014 - Nikolay SamokhvalovPostgreSQL Moscow Meetup - September 2014 - Nikolay Samokhvalov
PostgreSQL Moscow Meetup - September 2014 - Nikolay Samokhvalov
 
PG Day'14 Russia, PostgreSQL в avito.ru, Михаил Тюрин
PG Day'14 Russia, PostgreSQL в avito.ru, Михаил ТюринPG Day'14 Russia, PostgreSQL в avito.ru, Михаил Тюрин
PG Day'14 Russia, PostgreSQL в avito.ru, Михаил Тюрин
 
Что такое Postgresql (Максим Богук)
Что такое Postgresql (Максим Богук)Что такое Postgresql (Максим Богук)
Что такое Postgresql (Максим Богук)
 
Pgconfru 2015 kosmodemiansky
Pgconfru 2015 kosmodemianskyPgconfru 2015 kosmodemiansky
Pgconfru 2015 kosmodemiansky
 
Павел Лузанов, Postgres Professional. «PostgreSQL для пользователей Oracle»
Павел Лузанов, Postgres Professional. «PostgreSQL для пользователей Oracle»Павел Лузанов, Postgres Professional. «PostgreSQL для пользователей Oracle»
Павел Лузанов, Postgres Professional. «PostgreSQL для пользователей Oracle»
 
Владимир Бородин - PostgreSQL
Владимир Бородин - PostgreSQLВладимир Бородин - PostgreSQL
Владимир Бородин - PostgreSQL
 
Get to know PostgreSQL!
Get to know PostgreSQL!Get to know PostgreSQL!
Get to know PostgreSQL!
 
Postgres Presentation
Postgres PresentationPostgres Presentation
Postgres Presentation
 
Spilo, отказоустойчивый PostgreSQL кластер / Oleksii Kliukin (Zalando SE)
Spilo, отказоустойчивый PostgreSQL кластер / Oleksii Kliukin (Zalando SE)Spilo, отказоустойчивый PostgreSQL кластер / Oleksii Kliukin (Zalando SE)
Spilo, отказоустойчивый PostgreSQL кластер / Oleksii Kliukin (Zalando SE)
 
Борис Верюгин, Диасофт Платформа. «Автоматизированные механизмы миграции прил...
Борис Верюгин, Диасофт Платформа. «Автоматизированные механизмы миграции прил...Борис Верюгин, Диасофт Платформа. «Автоматизированные механизмы миграции прил...
Борис Верюгин, Диасофт Платформа. «Автоматизированные механизмы миграции прил...
 
Benchmarking PostgreSQL in Linux and FreeBSD
Benchmarking PostgreSQL in Linux and FreeBSDBenchmarking PostgreSQL in Linux and FreeBSD
Benchmarking PostgreSQL in Linux and FreeBSD
 
Андрей Кондрашов, Банк Москвы. «АБС в крупном Банке. Тестирование PostgreSQL...
Андрей Кондрашов, Банк Москвы.  «АБС в крупном Банке. Тестирование PostgreSQL...Андрей Кондрашов, Банк Москвы.  «АБС в крупном Банке. Тестирование PostgreSQL...
Андрей Кондрашов, Банк Москвы. «АБС в крупном Банке. Тестирование PostgreSQL...
 
Девять кругов ада или PostgreSQL Vacuum / Алексей Лесовский (PostgreSQL-Consu...
Девять кругов ада или PostgreSQL Vacuum / Алексей Лесовский (PostgreSQL-Consu...Девять кругов ада или PostgreSQL Vacuum / Алексей Лесовский (PostgreSQL-Consu...
Девять кругов ада или PostgreSQL Vacuum / Алексей Лесовский (PostgreSQL-Consu...
 

Similaire à Fast full-text search in PostgreSQL

PG Day'14 Russia, GIN — Stronger than ever in 9.4 and further, Александр Коро...
PG Day'14 Russia, GIN — Stronger than ever in 9.4 and further, Александр Коро...PG Day'14 Russia, GIN — Stronger than ever in 9.4 and further, Александр Коро...
PG Day'14 Russia, GIN — Stronger than ever in 9.4 and further, Александр Коро...pgdayrussia
 
10 Reasons to Start Your Analytics Project with PostgreSQL
10 Reasons to Start Your Analytics Project with PostgreSQL10 Reasons to Start Your Analytics Project with PostgreSQL
10 Reasons to Start Your Analytics Project with PostgreSQLSatoshi Nagayasu
 
Apache Tajo: Query Optimization Techniques and JIT-based Vectorized Engine
Apache Tajo: Query Optimization Techniques and JIT-based Vectorized EngineApache Tajo: Query Optimization Techniques and JIT-based Vectorized Engine
Apache Tajo: Query Optimization Techniques and JIT-based Vectorized EngineDataWorks Summit
 
Hadoop Summit 2014: Query Optimization and JIT-based Vectorized Execution in ...
Hadoop Summit 2014: Query Optimization and JIT-based Vectorized Execution in ...Hadoop Summit 2014: Query Optimization and JIT-based Vectorized Execution in ...
Hadoop Summit 2014: Query Optimization and JIT-based Vectorized Execution in ...Gruter
 
Parquet performance tuning: the missing guide
Parquet performance tuning: the missing guideParquet performance tuning: the missing guide
Parquet performance tuning: the missing guideRyan Blue
 
Типы данных JSONb, соответствующие индексы и модуль jsquery – Олег Бартунов, ...
Типы данных JSONb, соответствующие индексы и модуль jsquery – Олег Бартунов, ...Типы данных JSONb, соответствующие индексы и модуль jsquery – Олег Бартунов, ...
Типы данных JSONb, соответствующие индексы и модуль jsquery – Олег Бартунов, ...Yandex
 
PostgreSQL Moscow Meetup - September 2014 - Oleg Bartunov and Alexander Korotkov
PostgreSQL Moscow Meetup - September 2014 - Oleg Bartunov and Alexander KorotkovPostgreSQL Moscow Meetup - September 2014 - Oleg Bartunov and Alexander Korotkov
PostgreSQL Moscow Meetup - September 2014 - Oleg Bartunov and Alexander KorotkovNikolay Samokhvalov
 
Profiling and optimization
Profiling and optimizationProfiling and optimization
Profiling and optimizationg3_nittala
 
Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...
Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...
Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...InfluxData
 
Extending Spark for Qbeast's SQL Data Source​ with Paola Pardo and Cesare Cug...
Extending Spark for Qbeast's SQL Data Source​ with Paola Pardo and Cesare Cug...Extending Spark for Qbeast's SQL Data Source​ with Paola Pardo and Cesare Cug...
Extending Spark for Qbeast's SQL Data Source​ with Paola Pardo and Cesare Cug...Qbeast
 
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1MariaDB plc
 
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1MariaDB plc
 
CS101- Introduction to Computing- Lecture 29
CS101- Introduction to Computing- Lecture 29CS101- Introduction to Computing- Lecture 29
CS101- Introduction to Computing- Lecture 29Bilal Ahmed
 
SparkSQL: A Compiler from Queries to RDDs
SparkSQL: A Compiler from Queries to RDDsSparkSQL: A Compiler from Queries to RDDs
SparkSQL: A Compiler from Queries to RDDsDatabricks
 
Postgresql Database Administration Basic - Day2
Postgresql  Database Administration Basic  - Day2Postgresql  Database Administration Basic  - Day2
Postgresql Database Administration Basic - Day2PoguttuezhiniVP
 
What is new in PostgreSQL 14?
What is new in PostgreSQL 14?What is new in PostgreSQL 14?
What is new in PostgreSQL 14?Mydbops
 
Cassandra Java APIs Old and New – A Comparison
Cassandra Java APIs Old and New – A ComparisonCassandra Java APIs Old and New – A Comparison
Cassandra Java APIs Old and New – A Comparisonshsedghi
 
Building a Complex, Real-Time Data Management Application
Building a Complex, Real-Time Data Management ApplicationBuilding a Complex, Real-Time Data Management Application
Building a Complex, Real-Time Data Management ApplicationJonathan Katz
 
Checking clustering factor to detect row migration
Checking clustering factor to detect row migrationChecking clustering factor to detect row migration
Checking clustering factor to detect row migrationHeribertus Bramundito
 

Similaire à Fast full-text search in PostgreSQL (20)

PG Day'14 Russia, GIN — Stronger than ever in 9.4 and further, Александр Коро...
PG Day'14 Russia, GIN — Stronger than ever in 9.4 and further, Александр Коро...PG Day'14 Russia, GIN — Stronger than ever in 9.4 and further, Александр Коро...
PG Day'14 Russia, GIN — Stronger than ever in 9.4 and further, Александр Коро...
 
10 Reasons to Start Your Analytics Project with PostgreSQL
10 Reasons to Start Your Analytics Project with PostgreSQL10 Reasons to Start Your Analytics Project with PostgreSQL
10 Reasons to Start Your Analytics Project with PostgreSQL
 
Apache Tajo: Query Optimization Techniques and JIT-based Vectorized Engine
Apache Tajo: Query Optimization Techniques and JIT-based Vectorized EngineApache Tajo: Query Optimization Techniques and JIT-based Vectorized Engine
Apache Tajo: Query Optimization Techniques and JIT-based Vectorized Engine
 
Hadoop Summit 2014: Query Optimization and JIT-based Vectorized Execution in ...
Hadoop Summit 2014: Query Optimization and JIT-based Vectorized Execution in ...Hadoop Summit 2014: Query Optimization and JIT-based Vectorized Execution in ...
Hadoop Summit 2014: Query Optimization and JIT-based Vectorized Execution in ...
 
query_tuning.pdf
query_tuning.pdfquery_tuning.pdf
query_tuning.pdf
 
Parquet performance tuning: the missing guide
Parquet performance tuning: the missing guideParquet performance tuning: the missing guide
Parquet performance tuning: the missing guide
 
Типы данных JSONb, соответствующие индексы и модуль jsquery – Олег Бартунов, ...
Типы данных JSONb, соответствующие индексы и модуль jsquery – Олег Бартунов, ...Типы данных JSONb, соответствующие индексы и модуль jsquery – Олег Бартунов, ...
Типы данных JSONb, соответствующие индексы и модуль jsquery – Олег Бартунов, ...
 
PostgreSQL Moscow Meetup - September 2014 - Oleg Bartunov and Alexander Korotkov
PostgreSQL Moscow Meetup - September 2014 - Oleg Bartunov and Alexander KorotkovPostgreSQL Moscow Meetup - September 2014 - Oleg Bartunov and Alexander Korotkov
PostgreSQL Moscow Meetup - September 2014 - Oleg Bartunov and Alexander Korotkov
 
Profiling and optimization
Profiling and optimizationProfiling and optimization
Profiling and optimization
 
Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...
Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...
Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...
 
Extending Spark for Qbeast's SQL Data Source​ with Paola Pardo and Cesare Cug...
Extending Spark for Qbeast's SQL Data Source​ with Paola Pardo and Cesare Cug...Extending Spark for Qbeast's SQL Data Source​ with Paola Pardo and Cesare Cug...
Extending Spark for Qbeast's SQL Data Source​ with Paola Pardo and Cesare Cug...
 
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
 
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
 
CS101- Introduction to Computing- Lecture 29
CS101- Introduction to Computing- Lecture 29CS101- Introduction to Computing- Lecture 29
CS101- Introduction to Computing- Lecture 29
 
SparkSQL: A Compiler from Queries to RDDs
SparkSQL: A Compiler from Queries to RDDsSparkSQL: A Compiler from Queries to RDDs
SparkSQL: A Compiler from Queries to RDDs
 
Postgresql Database Administration Basic - Day2
Postgresql  Database Administration Basic  - Day2Postgresql  Database Administration Basic  - Day2
Postgresql Database Administration Basic - Day2
 
What is new in PostgreSQL 14?
What is new in PostgreSQL 14?What is new in PostgreSQL 14?
What is new in PostgreSQL 14?
 
Cassandra Java APIs Old and New – A Comparison
Cassandra Java APIs Old and New – A ComparisonCassandra Java APIs Old and New – A Comparison
Cassandra Java APIs Old and New – A Comparison
 
Building a Complex, Real-Time Data Management Application
Building a Complex, Real-Time Data Management ApplicationBuilding a Complex, Real-Time Data Management Application
Building a Complex, Real-Time Data Management Application
 
Checking clustering factor to detect row migration
Checking clustering factor to detect row migrationChecking clustering factor to detect row migration
Checking clustering factor to detect row migration
 

Plus de Ontico

One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...
One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...
One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...Ontico
 
Масштабируя DNS / Артем Гавриченков (Qrator Labs)
Масштабируя DNS / Артем Гавриченков (Qrator Labs)Масштабируя DNS / Артем Гавриченков (Qrator Labs)
Масштабируя DNS / Артем Гавриченков (Qrator Labs)Ontico
 
Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)
Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)
Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)Ontico
 
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...Ontico
 
Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...
Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...
Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...Ontico
 
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)Ontico
 
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...Ontico
 
Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...
Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...
Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...Ontico
 
ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)
ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)
ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)Ontico
 
MySQL Replication — Advanced Features / Петр Зайцев (Percona)
MySQL Replication — Advanced Features / Петр Зайцев (Percona)MySQL Replication — Advanced Features / Петр Зайцев (Percona)
MySQL Replication — Advanced Features / Петр Зайцев (Percona)Ontico
 
Внутренний open-source. Как разрабатывать мобильное приложение большим количе...
Внутренний open-source. Как разрабатывать мобильное приложение большим количе...Внутренний open-source. Как разрабатывать мобильное приложение большим количе...
Внутренний open-source. Как разрабатывать мобильное приложение большим количе...Ontico
 
Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...
Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...
Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...Ontico
 
Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...
Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...
Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...Ontico
 
Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)
Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)
Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)Ontico
 
И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)
И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)
И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)Ontico
 
Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)
Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)
Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)Ontico
 
Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)
Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)
Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)Ontico
 
100500 способов кэширования в Oracle Database или как достичь максимальной ск...
100500 способов кэширования в Oracle Database или как достичь максимальной ск...100500 способов кэширования в Oracle Database или как достичь максимальной ск...
100500 способов кэширования в Oracle Database или как достичь максимальной ск...Ontico
 
Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...
Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...
Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...Ontico
 
Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...
Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...
Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...Ontico
 

Plus de Ontico (20)

One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...
One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...
One-cloud — система управления дата-центром в Одноклассниках / Олег Анастасье...
 
Масштабируя DNS / Артем Гавриченков (Qrator Labs)
Масштабируя DNS / Артем Гавриченков (Qrator Labs)Масштабируя DNS / Артем Гавриченков (Qrator Labs)
Масштабируя DNS / Артем Гавриченков (Qrator Labs)
 
Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)
Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)
Создание BigData-платформы для ФГУП Почта России / Андрей Бащенко (Luxoft)
 
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...
Готовим тестовое окружение, или сколько тестовых инстансов вам нужно / Алекса...
 
Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...
Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...
Новые технологии репликации данных в PostgreSQL / Александр Алексеев (Postgre...
 
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
 
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
 
Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...
Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...
Опыт разработки модуля межсетевого экранирования для MySQL / Олег Брославский...
 
ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)
ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)
ProxySQL Use Case Scenarios / Alkin Tezuysal (Percona)
 
MySQL Replication — Advanced Features / Петр Зайцев (Percona)
MySQL Replication — Advanced Features / Петр Зайцев (Percona)MySQL Replication — Advanced Features / Петр Зайцев (Percona)
MySQL Replication — Advanced Features / Петр Зайцев (Percona)
 
Внутренний open-source. Как разрабатывать мобильное приложение большим количе...
Внутренний open-source. Как разрабатывать мобильное приложение большим количе...Внутренний open-source. Как разрабатывать мобильное приложение большим количе...
Внутренний open-source. Как разрабатывать мобильное приложение большим количе...
 
Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...
Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...
Подробно о том, как Causal Consistency реализовано в MongoDB / Михаил Тюленев...
 
Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...
Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...
Балансировка на скорости проводов. Без ASIC, без ограничений. Решения NFWare ...
 
Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)
Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)
Перехват трафика — мифы и реальность / Евгений Усков (Qrator Labs)
 
И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)
И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)
И тогда наверняка вдруг запляшут облака! / Алексей Сушков (ПЕТЕР-СЕРВИС)
 
Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)
Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)
Как мы заставили Druid работать в Одноклассниках / Юрий Невиницин (OK.RU)
 
Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)
Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)
Разгоняем ASP.NET Core / Илья Вербицкий (WebStoating s.r.o.)
 
100500 способов кэширования в Oracle Database или как достичь максимальной ск...
100500 способов кэширования в Oracle Database или как достичь максимальной ск...100500 способов кэширования в Oracle Database или как достичь максимальной ск...
100500 способов кэширования в Oracle Database или как достичь максимальной ск...
 
Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...
Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...
Apache Ignite Persistence: зачем Persistence для In-Memory, и как он работает...
 
Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...
Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...
Механизмы мониторинга баз данных: взгляд изнутри / Дмитрий Еманов (Firebird P...
 

Fast full-text search in PostgreSQL

  • 1. Полнотекстовый поиск в PostgreSQL за миллисекунды Олег Бартунов Александр Коротков
  • 2. Full-text search in DB ● Full-text search – Find documents, which satisfy query – return results in some order (opt.) ● Requirements to FTS – Full integration with DB core ● transaction support ● concurrency and recovery ● online index – Linguistic support – Flexibility, Scalability
  • 3. What is a document ? ● Arbitrary textual attribute ● Combination of textual attributes ● Could be fully virtual ● It's a textual result of any SQL, for example – join of doc and authors tables Title || Abstract || Keywords || Body || Author
  • 4. Text Search Operators ● Traditional FTS operators for textual attributes ~, ~*, LIKE, ILIKE Problems – No linguistic support, no stop-words – No ranking – Sequential scan all documents, slow Solution – Preprocess document in advance – Add index support
  • 5. FTS in PostgreSQL ● set of rules how document and query should be transformed to their FTS representations – tsvector, tsquery ● set of functions to obtain tsvector, tsquery from textual data types ● FTS operators and indexes ● ranking functions, headline
  • 6. FTS in PostgreSQL =# select 'a fat cat sat on a mat and ate a fat rat'::tsvector @@ 'cat & rat':: tsquery; – tsvector – storage for document, optimized for search • sorted array of lexemes • positional information • weights information – tsquery – textual data type for query • Boolean operators - & | ! () – FTS operator tsvector @@ tsquery
  • 7. FTS features ● Full integration with PostgreSQL ● 27 built-in configurations for 10 languages ● Support of user-defined FTS configurations ● Pluggable dictionaries ( ispell, snowball, thesaurus ), parsers ● Relevance ranking ● GiST and GIN indexes with concurrency and recovery support ● Rich query language with query rewriting support
  • 8. FTS in PostgreSQL ● OpenFTS — 2000, Pg as a storage ● GiST index — 2000, thanks Rambler ● Tsearch — 2001, contrib:no ranking ● Tsearch2 — 2003, contrib:config ● GIN —2006, thanks, JFG Networks ● FTS — 2006, in-core, thanks,EnterpriseDB ● E-FTS — Enterprise FTS, thanks ???
  • 9. ACID overhead is really big :( ● Foreign solutions: Sphinx, Solr, Lucene.... – Crawl database and index (time lag) – No access to attributes – Additional complexity – BUT: Very fast ! ● Can we improve native FTS ?
  • 10. Can we improve native FTS ? 1.Find relevant documents 1. Index scan — usually very fast 2.Calculate ranks for all founded documents 1. Heap scan — usually slow 3.Sort documents
  • 11. Can we improve native FTS ? 156676 Wikipedia articles: postgres=# explain analyze SELECT docid, ts_rank(text_vector, to_tsquery('english', 'title')) AS rank FROM ti2 WHERE text_vector @@ to_tsquery('english', 'title') ORDER BY rank DESC LIMIT 3; Limit (cost=8087.40..8087.41 rows=3 width=282) (actual time=433.750..433.752 rows= -> Sort (cost=8087.40..8206.63 rows=47692 width=282) (actual time=433.749..433 Sort Key: (ts_rank(text_vector, '''titl'''::tsquery)) Sort Method: top-N heapsort Memory: 25kB -> Bitmap Heap Scan on ti2 (cost=529.61..7470.99 rows=47692 width=282) ( Recheck Cond: (text_vector @@ '''titl'''::tsquery) -> Bitmap Index Scan on ti2_index (cost=0.00..517.69 rows=47692 wi Index Cond: (text_vector @@ '''titl'''::tsquery) Total runtime: 433.787 ms
  • 13. Can we improve native FTS ? 156676 Wikipedia articles: postgres=# explain analyze SELECT docid, ts_rank(text_vector, to_tsquery('english', 'title')) AS rank FROM ti2 WHERE text_vector @@ to_tsquery('english', 'title') ORDER BY text_vector>< plainto_tsquery('english','title') LIMIT 3; What if we have this plan ? Limit (cost=20.00..21.65 rows=3 width=282) (actual time=18.376..18.427 rows=3 loop -> Index Scan using ti2_index on ti2 (cost=20.00..26256.30 rows=47692 width=28 Index Cond: (text_vector @@ '''titl'''::tsquery) Order By: (text_vector >< '''titl'''::tsquery) Total runtime: 18.511 ms We'll be FINE !
  • 14. We'll be FINE ! ● Teach index (GIN) to calculate ranks and returns results in sorted order ● Store positions in index — no need for tsvector column, use compression to keep index small ● Change algorithms and interfaces
  • 15. We'll be FINE ! ● Additional benefit – T(rare_word & frequent_word) ~ T(rare_word)
  • 17. Inverted Index QUERY: compensation accelerometers INDEX: accelerometers compensation 5,10,25,28,30,36,58,59,61,73,74 30 30,68 30 RESULT: 30
  • 18. No positions in index ! Inverted Index in PostgreSQL E N T Posting list R Posting tree Y T R E E
  • 19. Summary of changes • GIN – storage – search – ORDER BY – interface • planner
  • 21. Add additional information (word positions)
  • 22. ItemPointer typedef struct ItemPointerData { BlockIdData ip_blkid; OffsetNumber ip_posid; } 6 bytes typedef struct BlockIdData { uint16 bi_hi; uint16 bi_lo; } BlockIdData;
  • 23. WordEntryPos /* * Equivalent to * typedef struct { * uint16 * weight:2, * pos:14; 2 bytes * } */ typedef uint16 WordEntryPos;
  • 25. OffsetNumber compression O0-O15 – OffsetNumber bits N – Additional information NULL bit
  • 26. WordEntryPos compression P0-P13 – position bits W0,W1 – weight bits
  • 29. Top-N queries 1. Scan + calc rank 2. Sort 3. Return using gingettuple one by one
  • 32. extractValue Datum *extractValue ( Datum itemValue, int32 *nkeys, bool **nullFlags, Datum *addInfo, bool *addInfoIsNull )
  • 33. extractQuery Datum *extractValue ( Datum query, int32 *nkeys, StrategyNumber n, bool **pmatch, Pointer **extra_data, bool **nullFlags, int32 *searchMode, ???bool **required??? )
  • 34. consistent bool consistent ( bool check[], StrategyNumber n, Datum query, int32 nkeys, Pointer extra_data[], bool *recheck, Datum queryKeys[], bool nullFlags[], Datum addInfo[], bool addInfoIsNull[] )
  • 35. calcRank float8 calcRank ( bool check[], StrategyNumber n, Datum query, int32 nkeys, Pointer extra_data[], bool *recheck, Datum queryKeys[], bool nullFlags[], Datum addInfo[], bool addInfoIsNull[] )
  • 38. Before test=# EXPLAIN (ANALYZE, VERBOSE) SELECT * FROM test ORDER BY slow_func(x,y) LIMIT 10; QUERY PLAN ------------------------------------------------------------------------------------------------------------------- Limit (cost=0.00..3.09 rows=10 width=16) (actual time=11.344..103.443 rows=10 loops=1) Output: x, y, (slow_func(x, y)) -> Index Scan using test_idx on public.test (cost=0.00..309.25 rows=1000 width=16) (actual time=11.341..103.422 rows=10 loops=1) Output: x, y, slow_func(x, y) Total runtime: 103.524 ms (5 rows)
  • 39. After test=# EXPLAIN (ANALYZE, VERBOSE) SELECT * FROM test ORDER BY slow_func(x,y) LIMIT 10; QUERY PLAN ------------------------------------------------------------------------------------------------------------------- Limit (cost=0.00..3.09 rows=10 width=16) (actual time=0.062..0.093 rows=10 loops=1) Output: x, y -> Index Scan using test_idx on public.test (cost=0.00..309.25 rows=1000 width=16) (actual time=0.058..0.085 rows=10 loops=1) Output: x, y Total runtime: 0.164 ms (5 rows)
  • 42. With tsvector column SELECT itemid, title FROM items WHERE fts @@ plainto_tsquery('russian', 'угловой шкаф') ORDER BY ts_rank(fts, plainto_tsquery('russian', 'угловой шкаф')) DESC LIMIT 10;
  • 43. With tsvector column without patch, Limit (cost=2341.92..2341.94 rows=10 width=398) (actual time=38.532..38.5 Buffers: shared hit=12830 -> Sort (cost=2341.92..2343.37 rows=581 width=398) (actual time=38.53 Sort Key: (ts_rank(fts, '''углов'' & ''шкаф'''::tsquery)) Sort Method: top-N heapsort Memory: 26kB Buffers: shared hit=12830 -> Bitmap Heap Scan on items (cost=48.50..2329.36 rows=581 widt Recheck Cond: (fts @@ '''углов'' & ''шкаф'''::tsquery) Buffers: shared hit=12830 -> Bitmap Index Scan on fts_idx (cost=0.00..48.36 rows=58 Index Cond: (fts @@ '''углов'' & ''шкаф'''::tsquery) Buffers: shared hit=116 Total runtime: 38.569 ms
  • 44. With tsvector column with patch, Limit (cost=40.00..80.28 rows=10 width=400) (actual time=11.528..11.536 Buffers: shared hit=374 -> Index Scan using fts_idx on items (cost=40.00..2863.77 rows=701 Index Cond: (fts @@ '''углов'' & ''шкаф'''::tsquery) Order By: (fts >< '''углов'' & ''шкаф'''::tsquery) Buffers: shared hit=374 Total runtime: 11.561 ms
  • 45. Without tsvector column SELECT itemid, title FROM items2 WHERE (setweight(to_tsvector('russian'::regconfig, title), 'A'::"char") || setweight(to_tsvector( 'russian'::regconfig, description), 'B'::"char")) @@ plainto_tsquery('russian', 'угловой шкаф') ORDER BY ts_rank((setweight(to_tsvector('russian'::regconfig, title), 'A'::"char") || setweight(to_tsvector('russian'::regconfig, description), 'B'::"char")), plainto_tsquery('russian', 'угловой шкаф')) DESC LIMIT 10;
  • 46. Without tsvector column, without patch Limit (cost=2596.31..2596.33 rows=10 width=372) (actual time=862.520..86 Buffers: shared hit=6875 -> Sort (cost=2596.31..2597.91 rows=642 width=372) (actual time=862.5 Sort Key: (ts_rank((setweight(to_tsvector('russian'::regconfig, Sort Method: top-N heapsort Memory: 26kB Buffers: shared hit=6875 -> Bitmap Heap Scan on items2 (cost=48.98..2582.44 rows=642 wid Recheck Cond: ((setweight(to_tsvector('russian'::regconfig, Buffers: shared hit=6875 -> Bitmap Index Scan on fts_idx2 (cost=0.00..48.82 rows=6 Index Cond: ((setweight(to_tsvector('russian'::regconfi Buffers: shared hit=116 Total runtime: 862.551 ms
  • 47. Without tsvector column, with patch Limit (cost=40.02..80.43 rows=10 width=373) (actual time=11.298..11.304 Buffers: shared hit=374 -> Index Scan using fts_idx2 on items2 (cost=40.02..2771.68 rows=676 Index Cond: ((setweight(to_tsvector('russian'::regconfig, title), Order By: ((setweight(to_tsvector('russian'::regconfig, title), Buffers: shared hit=374 Total runtime: 11.321 ms
  • 48. avito.ru: tests Without With patch With patch Sphinx patch without tsvector Table size 6.0 GB 6.0 GB 2.87 GB - Index size 1.29 GB 1.27 GB 1.27 GB 1.12 GB Index build 216 sec 303 sec 718sec 180 sec* time Queries in 8 3,0 mln. 42.7 mln. 42.7 mln. 32.0 mln. hours
  • 49. Anonymous source: 18 mln. docs
  • 50. Anonymous source: tests Without With With patch Sphinx patch patch without tsvector Table size 18.2 GB 18.2 GB 11.9 GB - Index size 2.28 GB 2.30 GB 2.30 GB 3.09 GB Index build 258 sec 684 sec 1712 sec 481 sec* time Queries in 8 2.67 mln. 38.7 mln. 38.7 mln. 26.7 mln. hours
  • 52. Status & Availability • 150 Kb patch for 9.3 • Datasets and workloads are welcome
  • 53. Plans & TODO • Fix recovery • Fix fastupdate • Fast scan interface • Accelerate index build if possible • Partial match support