Re: ScanKey representation for RowCompare index conditions
От | Martijn van Oosterhout |
---|---|
Тема | Re: ScanKey representation for RowCompare index conditions |
Дата | |
Msg-id | 20060116151649.GA21441@svana.org обсуждение исходный текст |
Ответ на | ScanKey representation for RowCompare index conditions (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: ScanKey representation for RowCompare index conditions
|
Список | pgsql-hackers |
On Sun, Jan 15, 2006 at 06:03:12PM -0500, Tom Lane wrote: > There's one nontrivial decision still to make about how to implement > proper per-spec row-comparison operations, namely: how a row > comparison ought to be represented in the index access method API. > The current representation of index conditions in the AM API is an > array of ScanKey structs, one per "indexcol op constant" index > condition, with implicit ANDing across all the conditions. There > are various bits of code that require the ScanKeys to appear in order > by index column, though this isn't inherent in the data structure > itself. ISTM that row-wise comparisons, as far as indexes are concerned are actually simpler than normal scan-keys. For example, if you have the condition (a,b) >= (5,1) then once the index has found that point, every subsequent entry in the index matches (except possibly NULLs). So you really don't actually need a row-comparison at any point after than. Now, if you have bracketing conditions like (a,b) BETWEEN (5,1) and (7,0) it gets more interesting. Ideally you'd want to pass both of these to the index so it knows when to stop. This really suggests using your plan B since you then have the possibility of passing both, which you don't really have with plan A. The latter also allows you to give more auxilliary conditions like b>4. So it seems like a good idea. No plan C I can think of... Have a nice day, -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a > tool for doing 5% of the work and then sitting around waiting for someone > else to do the other 95% so you can sue them.
В списке pgsql-hackers по дате отправления: