User: Password:
|
|
Subscribe / Log in / New account

PostgreSQL and the SQL standards process

PostgreSQL and the SQL standards process

Posted Sep 30, 2011 19:04 UTC (Fri) by Baylink (guest, #755)
In reply to: PostgreSQL and the SQL standards process by ringerc
Parent article: PostgreSQL and the SQL standards process

Very specifically: I'd like to see something that makes it easy to trace queries in, say, "mtop" back to the source code whence they came.

In that vein, and since the proper collection of eyeballs are probably reading the commments to this particular posting, I'd like to propose a device which might or might not work in that context, and get the input of people who know which:

Select $FIELDS from $TABLE where $CONDITIONS *AND NOT GETDATE() equals 1011-03-01* (where the date is some date earlier than today, and specific to each query; it serves as a tag).

Kevin Falcone, who I think is one of the SQL gurus on RT, suggested this would break the query cache, but I'm not sure that's true a) because it would be the same on any given query, and b) because it depends on a function, which can be evaluated away as part of the optimizer (assuming that keeps it from messing up the cache, which I don't know; hence, you folks. :-)

Anyone have an opinion on this, or the larger problem it's aimed at?


(Log in to post comments)

PostgreSQL and the SQL standards process

Posted Oct 5, 2011 10:52 UTC (Wed) by Jannes (guest, #80396) [Link]

Not sure what you're getting at actually. Why use a function at all, does the GETDATE have any use?

Why not use constants .... AND 0 < 78238923123 (your random tag) ?

And while you're at it, why not just make it a comment? I've used that before to make queries easily identifiable in SHOW PROCESSLIST: (in MySQL)

/* YourTag Function Name blabla */ SELECT * FROM blabla;

The comment has the extra advantage of not affecting the query cache at all (at least in MySQL).


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds