HypoPG / hypopg

Hypothetical Indexes for PostgreSQL
https://hypopg.readthedocs.io
Other
1.39k stars 59 forks source link

Test failure with PG11 #23

Closed df7cb closed 6 years ago

df7cb commented 6 years ago

hypopg compiles against PG11beta1, but doesn't pass the regression tests:

**** regression.diffs ****
*** /tmp/autopkgtest.O5qY5O/tree/expected/hypopg.out    2018-03-28 00:28:29.000000000 +0200
--- /tmp/autopkgtest.O5qY5O/tree/results/hypopg.out 2018-05-26 21:57:21.007399085 +0200
***************
*** 37,43 ****
  WHERE e ~ 'Index.*<\d+>btree_hypo.*';
   count 
  -------
!      1
  (1 row)

  -- Should use hypothetical index
--- 37,43 ----
  WHERE e ~ 'Index.*<\d+>btree_hypo.*';
   count 
  -------
!      0
  (1 row)

  -- Should use hypothetical index
***************
*** 45,51 ****
  WHERE e ~ 'Index.*<\d+>btree_hypo.*';
   count 
  -------
!      1
  (1 row)

  -- Should not use hypothetical index
--- 45,51 ----
  WHERE e ~ 'Index.*<\d+>btree_hypo.*';
   count 
  -------
!      0
  (1 row)

  -- Should not use hypothetical index
***************
*** 152,158 ****
  WHERE e ~ 'Index.*<\d+>btree_hypo.*';
   count 
  -------
!      1
  (1 row)

  -- Deparse an index DDL, with almost every possible pathcode
--- 152,158 ----
  WHERE e ~ 'Index.*<\d+>btree_hypo.*';
   count 
  -------
!      0
  (1 row)

  -- Deparse an index DDL, with almost every possible pathcode

======================================================================
rjuju commented 6 years ago

Ah indeed, thanks for reporting!

This is actually broken since covering indexes, I should have tested it earlier :(

Just setting up the new IndexOptInfo->nkeycolumns is enough to make the regression tests pass, but I'll have to do some more checking to make sure I didn't miss anything else. Also at least I'll have to at first disallow a hypothetical covering index until I implement its support for pg11.

rjuju commented 6 years ago

FWIW, I also missed support for parallel index scan. I'll add it too soon.

rjuju commented 6 years ago

I just pushed two commits for this the regression tests to explicitly disallowing the INCLUDE clause for pg11+, and added support for parallel index scan, it should fix the build. If everything is ok, I'll do a new release.

I'll add proper support for INCLUDE in a later commit.