Re: search like
by graq (Curate) on Feb 28, 2007 at 12:32 UTC
|
Further to answers above, you can add LIMIT functionality to your queries with the following:
| [reply] |
Re: search like
by Joost (Canon) on Feb 28, 2007 at 12:08 UTC
|
LSRfm::Database::CMS::Articles is irrelevant
No it isn't. Where is search_like defined?
| [reply] |
|
|
| [reply] |
|
|
| [reply] [d/l] [select] |
Re: search like
by Moron (Curate) on Feb 28, 2007 at 13:28 UTC
|
Not relevant? For all we know the database is a chemical-driven telepathic jellybase from the planet Zartog. "The three-headed jellybase developers never told me if their database architecture supports autojoins, with GROUP BY and HAVING clauses...."
...believe it or not there is a hint in there somewhere ;)
Update: Actually come to think of it, all you need is GROUP BY, + COUNT(*) - check out your database documentation (from whichever planet it comes ;))
More update: I am also influenced by the doubt as to whether DBI is artificially intelligent enough to insert the required clauses -- it might still query the database for all the rows that meet the where clause which might still be a query from hell at the database end, even though it might be constrained only to return 2 to the caller! Make sure you check the SQL generated by any Perl libraries you do try out.
| [reply] |
|
|
| [reply] |
|
|
Assuming the DBMS knows "explain", which is why I had to put in the caveat about the DBMS. I myself come from a Sybase background which requires different commands like "set showplan" to do that kind of thing. And what if it's mysql?
| [reply] |
|
|
O, its just last time i had a question regarding something similar, the perl lib, (custom built) was irrelvant, its just a table declarion, declaring my columns, and the table name, it calls the database parameters, and calls class::dbi and abstract search
Barry Carlyon
barry@barrycarlyon.co.uk
| [reply] |
|
|
You're right in saying that the contents of your specific class are (mostly) irrelevant, but its inheritance tree isn't. It would have been helpful if you had at least mentioned upfront that it derived from Class::DBI. It's always a good idea to supply enough information so that we don't have to guess where a certain method or function comes from.
| [reply] |
|
|
Re: search like
by CountZero (Bishop) on Feb 28, 2007 at 15:35 UTC
|
Did you ever think of switching from Class::DBI to DBIx::Class? They can use the LIMIT clause.
CountZero "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
| [reply] |
Re: search like
by barrycarlyon (Beadle) on Feb 28, 2007 at 13:08 UTC
|
| [reply] |