We allocate one map byte to each page, allowing us to record free space
at a granularity of 1/256th of a page. Another way to say it is that
the stored value is the free space divided by BLCKSZ/256 (rounding down).
But note that any database changes made by any one of these transactions remain invisible to the other transactions, as is usual for changes made by uncommitted transactions.
Вот есть таблица с 1000 записей. В ней 9 колонок. На 3 из них есть индексы.
1. Возможно ли дозапись новой колонки в существующую структуру? Или под капотом происходит полное копирование всех данных в новую таблицу (табличное пространство?)
2. Происходит ли пересоздание индексов?
3. Происходят ли какие-то еще важные для понимания сути работы в БД процессы?
SELECT DISTINCT ON (asin) asin, price, reviews, raing
(SELECT array_agg(j) FROM (SELECT DISTINCT ON (j.asin) j FROM jsonb_populate_recordset(NULL::t_best_asin_ranking_2, '[{
"asin":"B06XH9FNH1",
"price": 1.5,
"rating": 1.5,
"reviews": 1
}]') j ORDER BY j.asin) r);
melkij=> SELECT * from ts_debug('russian', 'дело сделать кот наконец то');
alias | description | token | dictionaries | dictionary | lexemes
-------+-------------------+---------+----------------+--------------+---------
word | Word, all letters | дело | {russian_stem} | russian_stem | {дел}
blank | Space symbols | | {} | |
word | Word, all letters | сделать | {russian_stem} | russian_stem | {сдела}
blank | Space symbols | | {} | |
word | Word, all letters | кот | {russian_stem} | russian_stem | {кот}
blank | Space symbols | | {} | |
word | Word, all letters | наконец | {russian_stem} | russian_stem | {}
blank | Space symbols | | {} | |
word | Word, all letters | то | {russian_stem} | russian_stem | {}
(9 строк)
lexemes text[] — the lexeme(s) produced by the dictionary that recognized the token, or NULL if none did; an empty array ({}) means it was recognized as a stop word
melkij=> SELECT ts_lexize('russian_stem', 'наконец');
ts_lexize
-----------
{}
ts_lexize returns an array of lexemes if the input token is known to the dictionary, or an empty array if the token is known to the dictionary but it is a stop word, or NULL if it is an unknown word.
select hotel_id, category, sum(price) as total_price from hotel_prices where date between ? and ? and not on_stop_sale group by 1,2 having count(*) = количество_дней_в_диапазоне order by total_price