Hi,
I am using the scripts for examples mentioned in the title on PostgreSQL 9.4 beta 3.
explain plan for using fast index:
explain plan for using slow index:
Are these number correct? And what are in other RDBMS's? asked Nov 12 '14 at 12:40 mladenuzelac |
You are having a misconception regarding what you are The function If you'd like to see the difference of the execution plan of the actual test query, you need to explain the text query itself:
(You need the extra prepare step due to the bind parameters in use: see here). You can see the result and how to read it here. EDIT
Yes, that's the whole point: there is just a "minor" difference in the indexes.
The parameters are really just used by the function which executes the query in a loop to take the benchmark. It it would always query the same data (e.g. section = 1 and id2=2) then it would run from main memory only and not give you the performance difference shown in the book. answered Nov 12 '14 at 12:54 Markus Winand ♦♦ Thank you for the fast reply. :D I am just learning PostgreSQL in and out, and I missed that section in the online book. Does it mean that I run the same query when using slow and fast index. I just skimmed the documentation. And it seems that second parameter is inferred. Does it mean that the section is selected and id2 is inferred? And how is it inferred in your query.
(Nov 12 '14 at 14:28)
mladenuzelac
|