9
голосов
6ответов
311 просмотров

Optimizing cartesian requests with affine costs

I have a cost optimization request that I don't know how if there is literature on. It is a bit hard to explain, so I apologize in advance for the length of the question. There is a server I am accessing that works this way: a request is made on records (r1, ...rn) and fields (f1, ...fp) you c...

1
голосов
2ответов
511 просмотров

How can a node in an execution plan have smaller costs than its child?

I always thought that a node in an execution plan can only be executed after its children have executed, and thus the total cost of a node has to be greater or equal than the cost of the child nodes. However, this is not always the case, like in the following example: Plan hash value: 2810258729...

96
голосов
9ответов
103128 просмотров

PostgreSQL - получить строку, которая имеет максимальное значение для столбца

Я имею дело с таблицей Postgres (называемой "жизнями"), которая содержит записи со столбцами для time_stamp, usr_id, transaction_id и life_remaining. Мне нужен запрос, который даст мне самое последнее количество жизней_перечисленных для каждого usr_id Есть несколько пользователей (разные us...