PostBOUND 0.23.2__tar.gz → 0.23.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. {postbound-0.23.2 → postbound-0.23.3}/PKG-INFO +1 -1
  2. {postbound-0.23.2 → postbound-0.23.3}/PostBOUND.egg-info/PKG-INFO +1 -1
  3. {postbound-0.23.2 → postbound-0.23.3}/postbound/_hints.py +14 -3
  4. {postbound-0.23.2 → postbound-0.23.3}/postbound/qal/_qal.py +2 -2
  5. {postbound-0.23.2 → postbound-0.23.3}/pyproject.toml +1 -1
  6. {postbound-0.23.2 → postbound-0.23.3}/LICENSE.txt +0 -0
  7. {postbound-0.23.2 → postbound-0.23.3}/PostBOUND.egg-info/SOURCES.txt +0 -0
  8. {postbound-0.23.2 → postbound-0.23.3}/PostBOUND.egg-info/dependency_links.txt +0 -0
  9. {postbound-0.23.2 → postbound-0.23.3}/PostBOUND.egg-info/requires.txt +0 -0
  10. {postbound-0.23.2 → postbound-0.23.3}/PostBOUND.egg-info/top_level.txt +0 -0
  11. {postbound-0.23.2 → postbound-0.23.3}/README.md +0 -0
  12. {postbound-0.23.2 → postbound-0.23.3}/postbound/__init__.py +0 -0
  13. {postbound-0.23.2 → postbound-0.23.3}/postbound/__init__.pyi +0 -0
  14. {postbound-0.23.2 → postbound-0.23.3}/postbound/_base.py +0 -0
  15. {postbound-0.23.2 → postbound-0.23.3}/postbound/_core.py +0 -0
  16. {postbound-0.23.2 → postbound-0.23.3}/postbound/_ipython.py +0 -0
  17. {postbound-0.23.2 → postbound-0.23.3}/postbound/_pipelines.py +0 -0
  18. {postbound-0.23.2 → postbound-0.23.3}/postbound/_qep.py +0 -0
  19. {postbound-0.23.2 → postbound-0.23.3}/postbound/_stages.py +0 -0
  20. {postbound-0.23.2 → postbound-0.23.3}/postbound/bench.py +0 -0
  21. {postbound-0.23.2 → postbound-0.23.3}/postbound/db/__init__.py +0 -0
  22. {postbound-0.23.2 → postbound-0.23.3}/postbound/db/_cache.py +0 -0
  23. {postbound-0.23.2 → postbound-0.23.3}/postbound/db/_db.py +0 -0
  24. {postbound-0.23.2 → postbound-0.23.3}/postbound/db/_stats.py +0 -0
  25. {postbound-0.23.2 → postbound-0.23.3}/postbound/duckdb/__init__.py +0 -0
  26. {postbound-0.23.2 → postbound-0.23.3}/postbound/duckdb/_duckdb.py +0 -0
  27. {postbound-0.23.2 → postbound-0.23.3}/postbound/opt/__init__.py +0 -0
  28. {postbound-0.23.2 → postbound-0.23.3}/postbound/opt/__init__.pyi +0 -0
  29. {postbound-0.23.2 → postbound-0.23.3}/postbound/opt/_cardinalities.py +0 -0
  30. {postbound-0.23.2 → postbound-0.23.3}/postbound/opt/_dynprog.py +0 -0
  31. {postbound-0.23.2 → postbound-0.23.3}/postbound/opt/_enumeration.py +0 -0
  32. {postbound-0.23.2 → postbound-0.23.3}/postbound/opt/_helpers.py +0 -0
  33. {postbound-0.23.2 → postbound-0.23.3}/postbound/opt/_native.py +0 -0
  34. {postbound-0.23.2 → postbound-0.23.3}/postbound/opt/_randomized.py +0 -0
  35. {postbound-0.23.2 → postbound-0.23.3}/postbound/parser.py +0 -0
  36. {postbound-0.23.2 → postbound-0.23.3}/postbound/postgres/__init__.py +0 -0
  37. {postbound-0.23.2 → postbound-0.23.3}/postbound/postgres/_config.py +0 -0
  38. {postbound-0.23.2 → postbound-0.23.3}/postbound/postgres/_ctl.py +0 -0
  39. {postbound-0.23.2 → postbound-0.23.3}/postbound/postgres/_explain.py +0 -0
  40. {postbound-0.23.2 → postbound-0.23.3}/postbound/postgres/_pg.py +0 -0
  41. {postbound-0.23.2 → postbound-0.23.3}/postbound/qal/__init__.py +0 -0
  42. {postbound-0.23.2 → postbound-0.23.3}/postbound/qal/_formatter.py +0 -0
  43. {postbound-0.23.2 → postbound-0.23.3}/postbound/relalg.py +0 -0
  44. {postbound-0.23.2 → postbound-0.23.3}/postbound/train/__init__.py +0 -0
  45. {postbound-0.23.2 → postbound-0.23.3}/postbound/train/_train.py +0 -0
  46. {postbound-0.23.2 → postbound-0.23.3}/postbound/transform.py +0 -0
  47. {postbound-0.23.2 → postbound-0.23.3}/postbound/util/__init__.py +0 -0
  48. {postbound-0.23.2 → postbound-0.23.3}/postbound/util/__init__.pyi +0 -0
  49. {postbound-0.23.2 → postbound-0.23.3}/postbound/util/_df.py +0 -0
  50. {postbound-0.23.2 → postbound-0.23.3}/postbound/util/_errors.py +0 -0
  51. {postbound-0.23.2 → postbound-0.23.3}/postbound/util/collections.py +0 -0
  52. {postbound-0.23.2 → postbound-0.23.3}/postbound/util/dicts.py +0 -0
  53. {postbound-0.23.2 → postbound-0.23.3}/postbound/util/jsonize.py +0 -0
  54. {postbound-0.23.2 → postbound-0.23.3}/postbound/util/logging.py +0 -0
  55. {postbound-0.23.2 → postbound-0.23.3}/postbound/util/misc.py +0 -0
  56. {postbound-0.23.2 → postbound-0.23.3}/postbound/util/num.py +0 -0
  57. {postbound-0.23.2 → postbound-0.23.3}/postbound/util/nx.py +0 -0
  58. {postbound-0.23.2 → postbound-0.23.3}/postbound/util/proc.py +0 -0
  59. {postbound-0.23.2 → postbound-0.23.3}/postbound/util/stats.py +0 -0
  60. {postbound-0.23.2 → postbound-0.23.3}/postbound/util/system.py +0 -0
  61. {postbound-0.23.2 → postbound-0.23.3}/postbound/util/typing.py +0 -0
  62. {postbound-0.23.2 → postbound-0.23.3}/postbound/validation.py +0 -0
  63. {postbound-0.23.2 → postbound-0.23.3}/postbound/vis/__init__.py +0 -0
  64. {postbound-0.23.2 → postbound-0.23.3}/postbound/vis/__init__.pyi +0 -0
  65. {postbound-0.23.2 → postbound-0.23.3}/postbound/vis/fdl.py +0 -0
  66. {postbound-0.23.2 → postbound-0.23.3}/postbound/vis/graphs.py +0 -0
  67. {postbound-0.23.2 → postbound-0.23.3}/postbound/vis/optimizer.py +0 -0
  68. {postbound-0.23.2 → postbound-0.23.3}/postbound/vis/plots.py +0 -0
  69. {postbound-0.23.2 → postbound-0.23.3}/postbound/vis/trees.py +0 -0
  70. {postbound-0.23.2 → postbound-0.23.3}/postbound/workloads.py +0 -0
  71. {postbound-0.23.2 → postbound-0.23.3}/setup.cfg +0 -0
  72. {postbound-0.23.2 → postbound-0.23.3}/tests/test_benchmarking.py +0 -0
  73. {postbound-0.23.2 → postbound-0.23.3}/tests/test_core.py +0 -0
  74. {postbound-0.23.2 → postbound-0.23.3}/tests/test_docs.py +0 -0
  75. {postbound-0.23.2 → postbound-0.23.3}/tests/test_duckdb.py +0 -0
  76. {postbound-0.23.2 → postbound-0.23.3}/tests/test_postgres.py +0 -0
  77. {postbound-0.23.2 → postbound-0.23.3}/tests/test_qal.py +0 -0
  78. {postbound-0.23.2 → postbound-0.23.3}/tests/test_relalg.py +0 -0
  79. {postbound-0.23.2 → postbound-0.23.3}/tests/test_util.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PostBOUND
3
- Version: 0.23.2
3
+ Version: 0.23.3
4
4
  Summary: PostBOUND is a research framework to prototype and benchmark database query optimizers
5
5
  Author-email: Rico Bergmann <rico.bergmann1@tu-dresden.de>
6
6
  License-Expression: Apache-2.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PostBOUND
3
- Version: 0.23.2
3
+ Version: 0.23.3
4
4
  Summary: PostBOUND is a research framework to prototype and benchmark database query optimizers
5
5
  Author-email: Rico Bergmann <rico.bergmann1@tu-dresden.de>
6
6
  License-Expression: Apache-2.0
@@ -684,8 +684,12 @@ class PlanParameterization:
684
684
  PlanParameterization
685
685
  The parameters are updated in place and returned for chaining.
686
686
  """
687
+ tables = frozenset(tables)
688
+ if not tables:
689
+ raise ValueError("Cannot assign cardinality to an empty set of tables")
690
+
687
691
  cardinality = Cardinality.of(cardinality)
688
- self.cardinalities[frozenset(tables)] = cardinality
692
+ self.cardinalities[tables] = cardinality
689
693
  return self
690
694
 
691
695
  def set_workers(self, tables: Iterable[TableReference], num_workers: int) -> Self:
@@ -1694,6 +1698,13 @@ def parameters_from_plan(
1694
1698
  `fallback_estimated` is set.
1695
1699
  """
1696
1700
  params = PlanParameterization()
1701
+ tables = query_plan.tables()
1702
+ if not tables:
1703
+ # There are no more base tables left in the plan. No point to traverse further.
1704
+ # Note that this situation is completely legit: For example, consider Postgres Bitmap Scans:
1705
+ # The heap scan contains the actual table while its children (the index lookups) only reference
1706
+ # the indexes. Once we recurse from the heap scan into the index lookups, no base tables are left.
1707
+ return params
1697
1708
 
1698
1709
  if isinstance(query_plan, JoinTree):
1699
1710
  card = query_plan.annotation
@@ -1712,9 +1723,9 @@ def parameters_from_plan(
1712
1723
  parallel_workers = query_plan.params.parallel_workers
1713
1724
 
1714
1725
  if card is not None and not math.isnan(card):
1715
- params.add_cardinality(query_plan.tables(), card)
1726
+ params.add_cardinality(tables, card)
1716
1727
  if parallel_workers:
1717
- params.set_workers(query_plan.tables(), parallel_workers)
1728
+ params.set_workers(tables, parallel_workers)
1718
1729
 
1719
1730
  for child in query_plan.children:
1720
1731
  child_params = parameters_from_plan(
@@ -4024,7 +4024,7 @@ def _attempt_filter_unwrap(
4024
4024
  assert isinstance(lhs, ColumnReference)
4025
4025
  return lhs, BinaryOperator.Between, (lower, upper)
4026
4026
 
4027
- case InPredicate(lhs, values):
4027
+ case InPredicate(lhs, values, op):
4028
4028
  status, lhs = _unwrap_expression(lhs)
4029
4029
  if not status:
4030
4030
  return None
@@ -4037,7 +4037,7 @@ def _attempt_filter_unwrap(
4037
4037
  unwrapped_vals.append(unwrapped)
4038
4038
 
4039
4039
  assert isinstance(lhs, ColumnReference)
4040
- return lhs, BinaryOperator.In, tuple(unwrapped_vals)
4040
+ return lhs, op, tuple(unwrapped_vals)
4041
4041
 
4042
4042
  case UnaryPredicate(col, op) if predicate.is_null_test() or predicate.is_bool_test():
4043
4043
  status, col = _unwrap_expression(col)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "PostBOUND"
7
- version = "0.23.2"
7
+ version = "0.23.3"
8
8
  authors = [{ name = "Rico Bergmann", email = "rico.bergmann1@tu-dresden.de" }]
9
9
  description = "PostBOUND is a research framework to prototype and benchmark database query optimizers"
10
10
  readme = "README.md"
File without changes
File without changes
File without changes
File without changes
File without changes