Re: "Type does not exist" error when returning array of type in non-public schema

2025-02-06 Thread Chris Cleveland
I solved the problem with: CREATE FUNCTION myfunc ... RETURNS Token[] ... SET search_path to rdb; I still don't know why it happens in the first place, though. On Thu, Feb 6, 2025 at 12:14 PM Tom Lane wrote: > "David G. Johnston" writes: > > On Thu, Feb 6, 2025 at

"Type does not exist" error when returning array of type in non-public schema

2025-02-06 Thread Chris Cleveland
REATE FUNCTION my_func ... RETURNS Token[] ... No amount of fiddling with the syntax seems to help. RETURN rdb.Token[], RETURN "rdb.Token"[], RETURN "rdb.Token[]" all fail. This problem is happening in pg17. Haven't tried other versions. Is there a solution here? -- Chris Cleveland 312-339-2677 mobile

Graceful way to handle too many locks

2024-11-13 Thread Chris Cleveland
r the limit, instead of later? -- Chris Cleveland 312-339-2677 mobile

Implementing CustomScan over an index

2024-05-29 Thread Chris Cleveland
just a normal index scan, but with the ability to do custom things with the quals and the projection. So... what's the best approach? Is there any sample code that does this? A search of github doesn't turn up much. Is there any way to do this without duplicating everything in node

Re: Why is FOR ORDER BY function getting called when the index is handling ordering?

2024-05-02 Thread Chris Cleveland
or that, though: IndexScanDesc.xs_orderbyvals. If there were a way for the system to use that instead of a call to the ordering function, we'd be all set. It would also be nice if the orderbyval could be made available in the projection. That way we could report the score() in the result set. Matthias' response and links touch on some of these issues. -- Chris Cleveland 312-339-2677 mobile

Why is FOR ORDER BY function getting called when the index is handling ordering?

2024-05-02 Thread Chris Cleveland
nfo, but I can't figure out where or why it's getting set. Here's a sample query. I have not found a query that does *not* call rank_match(): SELECT * FROM products WHERE products <===> rdb.userquery('teddy') ORDER BY products <<=>> rdb.rank(); I'd be grateful for any help or insights. -- Chris Cleveland 312-339-2677 mobile

Possible to get LIMIT in an index access method?

2024-04-29 Thread Chris Cleveland
ess method is designed such that you have to fetch the entire result set in one go. It's not streaming, like most access methods. As such, it would be very helpful to know up front how many items I need to fetch from the index. -- Chris Cleveland 312-339-2677 mobile

Index access method not receiving an orderbys ScanKey

2024-04-25 Thread Chris Cleveland
nscan); amroutine.amrescan = Some(scan::amrescan); amroutine.amgettuple = Some(scan::amgettuple); amroutine.amgetbitmap = None; // Some(scan::ambitmapscan); amroutine.amendscan = Some(scan::amendscan); amroutine.ammarkpos = None; amroutine.amrestrpos = None; /* interface functions to support parallel index scans */ amroutine.amestimateparallelscan = None; amroutine.aminitparallelscan = None; amroutine.amparallelrescan = None; amroutine.into_pg_boxed() } -- Chris Cleveland 312-339-2677 mobile

Possible to trigger autovacuum?

2024-02-19 Thread Chris Cleveland
fire up a background worker to do the job, but it would be a lot simpler to call please_launch_autovacuum_right_now(); -- Chris Cleveland 312-339-2677 mobile

Projection pushdown to index access method

2023-09-19 Thread Chris Cleveland
that case we make a custom PathTarget for it. * *For example, an indexscan might return index expressions that would * otherwise need to be explicitly calculated.* -- Chris Cleveland 312-339-2677 mobile

Simple CustomScan example

2023-09-06 Thread Chris Cleveland
simple example of a custom scan? Or maybe a tutorial? -- Chris Cleveland 312-339-2677 mobile

Managing my own index partitions

2022-08-08 Thread Chris Cleveland
baseobject.objectId = parent_oid; baseobject.objectSubId = 0; segobject.classId = IndexRelationId; segobject.objectId = child_oid; segobject.objectSubId = 0; recordDependencyOn(&segobject, &baseobject, DEPENDENCY_INTERNAL); } The code where I use heap_create_with_catalog() is substantially the same. -- Chris Cleveland 312-339-2677 mobile

Managing my own index partitions

2022-08-08 Thread Chris Cleveland
I'm building a Postgres index access method. For a variety of reasons it's more efficient to store the index data in multiple physical files on disk rather in the index's main fork. I'm trying to create separate rels that can be created and destroyed by the parent index access method. I've succeed

Atomic GetFreeIndexPage()?

2022-05-04 Thread Chris Cleveland
etFreeIndexPage() with a lightweight lock, although I wonder if that would harm performance. Perhaps there is a more performant way to do this deep down in the FSM code. Thoughts? -- Chris Cleveland 312-339-2677 mobile

External data files possible?

2022-02-21 Thread Chris Cleveland
It's turning out to be difficult to store the data for my custom index access method in the main fork. Breaking up the data into pages with page headers means a lot of extra work, a big performance hit, and disk space management headaches. It's just not a good fit for my particular file format. It

Possible to go without page headers?

2022-02-14 Thread Chris Cleveland
I'm writing an index access method with its own unique file format. It involves storing large blobs that break across pages. The file format itself doesn't need or use page headers. There's no need for a checksum or to manage free space within the page. Can I treat pages as just a flat, open 8k b

More data files / forks

2022-01-11 Thread Chris Cleveland
I'm working on a table access method that stores indexes in a structure that looks like an LSM tree. Changes get written to small segment files, which then get merged into larger segment files. It's really tough to manage these files using existing fork/buffer/page files, because when you delete a

Look at all paths?

2021-12-28 Thread Chris Cleveland
I'm developing a new index access method. Sometimes the planner uses it and sometimes it doesn't. I'm trying to debug the process to understand why the index does or doesn't get picked up. Is there a way to dump all of the query plans that the planner considered, along with information on why they

Re: 64 bit TID?

2021-09-13 Thread Chris Cleveland
Pointer to 64 bits now preclude a variable-length TID in the future? Or make it more difficult? How much work would it take? Since the thread ended in May, has the group reached any kind of consensus on the issue? -- Chris Cleveland 312-339-2677 mobile

64 bit TID?

2021-09-13 Thread Chris Cleveland
ks to widen the TID? I saw some notes on this in the Zedstore project, but there hasn't been much activity in that project for almost a year. Chris -- Chris Cleveland 312-339-2677 mobile

Passing data out of indexam or tableam

2021-08-02 Thread Chris Cleveland
and attach it only to the first row. Is this possible? Is it possible to do it with a table access method, as opposed to an index access method? -- Chris Cleveland 312-339-2677 mobile

Re: Transactions and indexes

2021-07-22 Thread Chris Cleveland
> > Are you implementing a new index AM or a new table AM? Discarding data > based on something like a relevance score doesn't seem like something > that either API provides for. Indexes in Postgres can be lossy, but > that in itself doesn't change the result of queries. > (Sorry if this doesn't q

Re: Transactions and indexes

2021-07-22 Thread Chris Cleveland
is not going to work unless the system gives the index a clear picture of transactions, visibility, and deletes as they happen. Is this information available? On Mon, Jul 19, 2021 at 6:58 PM Peter Geoghegan wrote: > On Mon, Jul 19, 2021 at 4:31 PM Chris Cleveland > wrote: > &g

Transactions and indexes

2021-07-19 Thread Chris Cleveland
an. I'm guessing that all that magically happens in the storage and buffer managers. So... how do I handle this? Is there some way for me to implement my own storage manager that manages visibility? I'd be grateful for any guidance. -- Chris Cleveland 312-339-2677 mobile

Possible to modify query language in an extension?

2019-03-16 Thread Chris Cleveland
Noob here. I'm getting started on building a Postgres extension. I'd like to add some keywords/clauses to the SELECT statement. For my particular application, the syntax with new keywords would be way better than trying to do it through functions alone. I would add some new keywords followed by ex