Search Postgresql Archives

question about performance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi PostgreSQLer,

if I have a table, the_table, with a DATE field, i'll call it 'day', and I'd like to find all rows whos day falls within a given month, which of the following methods is faster/costs less:

1.

	SELECT * FROM the_table WHERE day LIKE '2008-01-%';

2.
	
	SELECT * FROM the_table
		WHERE ( day BETWEEN '$month_begin' AND '$month_end' );
	
	# where $month_begin is '2008-01-01' and $month_end is '2008-01-31';

thanks,

Rob Urban


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux