Philip Martin <[email protected]> writes:
> I need something like
>
> local_relpath = 'zig1/zag27
> OR (local_relpath > 'zig1/zag27/' AND local_relpath < 'zig1/zag270')
>
> and that is as slow as LIKE. Adding that "local_relpath =" is the
> problem, without it I get the children in 0.006s. With it I get the
> path and the children but it takes 0.35s.
SQL is tricky: I can run a query using either
local_relpath = 'zig1/zag27
or using
local_relpath > 'zig1/zag27/' AND local_relpath < 'zig1/zag270'
and it takes 0.006s, but if I put in both parts in together with OR it
takes 0.35s. That's 2 orders of magnitude! I suppose I will have to
try using EXPLAIN.
--
Philip